Download the PHP package petrofcikmatus/zf-layout-change without Composer
On this page you can find all versions of the php package petrofcikmatus/zf-layout-change. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download petrofcikmatus/zf-layout-change
More information about petrofcikmatus/zf-layout-change
Files in petrofcikmatus/zf-layout-change
Package zf-layout-change
Short Description Zend Framework module for layout change based on used controller namespace.
License MIT
Homepage https://github.com/petrofcikmatus/zf-layout-change
Informations about the package zf-layout-change
ZF Layout Change Module
This is a Zend Framework 3 module, that can simply set different layouts for different modules.
If you have multiple modules in your application (e.g. Application and Admin), and you want different layout for some module (e.g. Admin), this package will provide easiest way to do that change.
How to use this package
1. Install this module with composer
Simplest way to install this package is to use following composer command to require dependency:
Alternatively you can add following to your composer.json file manualy:
and execute composer command to update your dependencies (and also download this new one):
2. Add this module to your modules
When you add this package with composer, it should automatically ask in which file you want add new module.
If this did not happen, you have to add 'ZFLayoutChange'
value to the array with your modules. It should be in file config/application.config.php or config/modules.config.php, and look like this:
3. Add array with layouts for your modules
Add a new array with key module_layouts
in your global configuration file config/autoload/global.php, or to module.config.php for some modules if you want.
In the example above, controllers in Admin module (and namespace) will use layout layout/admin. Otherwise, it will use default configured layout.
4. That is all!
Enjoy your layout changing :)
See a bug? Want to contribute?
If you see any bug or you experience any troubles, please open a new issue or commit bugfix, I will look at it.
If you want to change something (maybe I didn't make it the best way), feel free to fork repository and create new merge requests.
Also if you want this on Zend Framework 2, feel free to contribute. I do not use ZF2 anymore, so it is up to you now.
License
This module uses MIT license.