[英]How to run a function on every page in ZF2
I'm new to ZEND so go easy, I have a menu table set up in mysql called menu_table, how do I run a function on every page to select * from that table and then pass it through to Module/Application/View/layout/layout.phtml 我是ZEND的新手,所以简单一点,我在mysql中设置了一个名为menu_table的菜单表,如何在每个页面上运行一个函数来从该表中选择*然后将其传递给Module / Application / View / layout /layout.phtml
Many thanks 非常感谢
The best practice in this case would be to create custom View Helper to get all menu items from the menu_table. 在这种情况下,最佳做法是创建自定义View Helper以从menu_table获取所有菜单项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.