Hi, I want to know how to override Navigation helper and it’s plugins, namely Menu, Breadcrumb, Links, SiteMap. In Zf2 this can be done by finding out the configuration key and override it. But in Laminas this is not the case. As Navigation is no longer a built in part of Laminas View and you can see that in Laminas\View\PluginManager
, if I’m correct. So, how to override Navigation helper and it’s menu. The code which use to work in zf2 was something like below:
'view_helpers' => [
'factories' => [
'navigations' => \Application\View\Navigation::class,
]
]
But this above code gives error “Bad method call: Unknown method Laminas\Navigation\Navigation::menu”. Even if I change “navigation” to FCQN it gives error. In my getPluginManager()
method I’ve override the values of the property aliases like below:
class PluginManager extends LaminasPluginManager{
protected $aliases = [
'breadcrumbs' => \Laminas\View\Helper\Navigation\Breadcrumbs::class,
'links' => \Laminas\View\Helper\Navigation\Links::class,
'menu' => \Application\View\Helper\Navigation\Menu::class,
'sitemap' => \Laminas\View\Helper\Navigation\Sitemap::class,
];
Thanks in advance!