我在网上找到了一种使用以下方法声明自定义导航菜单的方法: p> \ 现在我想将参数传递给自定义 我应该使用的数组结构和方法的任何想法/提示? p>
非常感谢, p>
div> Acl code>模块中的
'navigation_helpers'=> 数组(
'invokables'=>数组(
'菜单'=>'Acl \ View \ Helper \ Navigation \ Menu',
)
),
code> pre> \ n
Menu code>构造函数。 我在ZF2世界中很新,但似乎我必须在
module.php code>文件中创建某种服务。 我试图将代码放入
getServiceConfig code>和
getViewHelperConfig code>方法但没有成功(自定义菜单没有“使用”)。 p>
I've found on the web a way to declare a custom Navigation Menu using the following:
module.config.php
in Acl
module:
'navigation_helpers' => array(
'invokables' => array(
'menu' => 'Acl\View\Helper\Navigation\Menu',
)
),
Now I'd like to pass a parameter to the custom Menu
constructor. I'm quite new in ZF2 world but it seems that I have to create some kind of service in the module.php
file. I've tried to put code into getServiceConfig
and getViewHelperConfig
methods without success (the custom menu is not "used").
Any idea/hint of the array structure and the method I should use?
Thanks a lot,