I have earlier asked this question, and I got good answers there. However, that was for beta4, and no longer works.
So where and how do I add my own view helpers to ZF2?
I have earlier asked this question, and I got good answers there. However, that was for beta4, and no longer works.
So where and how do I add my own view helpers to ZF2?
The beta5 had a BC regarding the servicemanager. This applies for the view helper manager as well. Have a look here - there's even an example for view helpers a bit down too.
You should add them to your
module.config.php
underview_helpers
like this:Here I show two ways of creating the helpers. If all they need to do is to be instantiated, just add their name (including namespace) as
invokables
. If you need to do stuff with them or theServiceManager
, create them through thefactories
keyword.