Possible Duplicate:
How to add custom view helpers to Zend Framework 2
I keep getting ServiceNotFoundExceptions when attempting to load a view helper in ZF2. My module configuration is as follows:
'view_manager' => [
'template_path_stack' => [
'stock' => __DIR__ . '/../view'
],
'invokables' => [
'navlink' => 'Application\View\Helper\NavLinkHelper'
]
]
The class doesn’t seem to be added to the plugin registry. I’ve found several different methods posted over the past 6 months, none of which work. Apparently the official documentation (suggesting use of helper_map) is also out-of-date. Any ideas?
Modify your
module.config.phpto include the following array. Please notice the difference of the array_key used to declare the helper-mapping.