In Zend Framework 2, how can I have one view helper available to multiple modules?
What I want is to have some general functions, like algorithmic functions, that can be reused by multiple modules.
I’m currently on ZF 2 2.0.3
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Its simple, put it in one of your modules. You can use classes and functions from other modules in ZF2. Because modules in ZF2 aren’t much more than just namespaces, with some classes in them. So, if you create a view helper with the name
\Module\View\Helper\MyHelper, you can simply use that view helper in another module.