开发者

Building a menu system in Symfony2, with static parent links but dynamic sub page links

开发者 https://www.devze.com 2023-04-03 13:43 出处:网络
In this project, I have a menu for the navigation for the website. Due to design constraints, these links are hard coded in the project. They won\'t be changed (at the request of the designer and the

In this project, I have a menu for the navigation for the website. Due to design constraints, these links are hard coded in the project. They won't be changed (at the request of the designer and the client).

However, they wish to have drop down menus with items that can be added or removed. I have had a quick look on Google, and I haven't come across a w开发者_Python百科ay to do this.

I did manage to make a crude dynamic menu system, but the performance overheads were way too high using this system.

Is there anything clever I could do to achieve this?

Cheers!


If you're not pigeonholed into a self-built system (it doesn't sound like you are, since you're using a framework), have a look at the KnpMenuBundle. It's quite flexible, and depending on what you mean by "items that can be added or removed", you could combine it with a simple CRUD interface for a MenuItem system to let authorized users change the submenus.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号