I have a question about layouts in Zend Framework.
This is my structure of my project:
- I have 2 modules named “backoffice” and “frontoffice”.
- I have one layout.phtml in layouts/scripts for both the backoffice and frontoffice.
- Now I want seperate “layouts/scripts” for “backoffice” and “frontoffice”
- In my application.ini I have:
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
Now how can I fix this that I have seperate layouts?
Just place another layout in the
layout/scriptsfolder and tell any module, controller or action to use that other layout instead of the default layout.If you want to let a controller use a different layout, you can place the following in your
init()You can do that respectively for specific actions or for a whole module.