Zend Service Manager component is Zend Framework’s implementation of service locator pattern. This object is very usefull component for an application and is largely used in ZF applications.
Unfortunately in ZF3 default application, Service Manager component is no more available in controllers.
An official solution exsists for this, but in this little tutorial, I want to share an easy solution to inject Service Manager in all controllers.
Sometimes in our Zend Framework 3 multi-language application, we could need to access to Zend Translator component directly from Controllers. For example, when we have to translate a string to return in a JsonModel.
So, let’s see how to write a very simple Controller Plugin that will help us to save a lot of code (and time).
Following explanation will assume we just have at least a Skeleton ZF3 Application with working Zend Translator component.
Yesterday, Evan Coury, Zend Framework contibutor, announced start of Zend Framework branch.
Development goals will be merged between ZF team ideas and community suggestions that will be collected in this topic. Anyway, Evan immediatly specifies that development will be focused on avoid dramatic migration as was for transition from ZF1 to ZF2.
For all developers that use Zend Framework for their projects, this is the best opportunity to take part to development process and be heard about their needs: power of Open Source.