tasmaniski / zend-layout-change
Listener to change layout for different module
Installs: 2 330
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: >=5.6
This package is auto-updated.
Last update: 2024-11-08 07:09:48 UTC
README
If you have modular app you probably want more that a single layout for eg. admin-layout and web-layout. Currently that is not supported by default in zend framework.
This package will enable you to set different layout for modules.
Install it
Add in your composer.json file:
{ "require": { "tasmaniski/zend-layout-change": "^1.0" } }
After running: sudo composer update you need to register new module.
Add in file config/application.config.php:
'modules' => array(
'...',
'LayoutChange'
),
How to Use it
You have to create layout.phtml file per modul. For eg. if you have Admin and Web modules, you should create:
Web/view/layout/web-layout.phtml
Admin/view/layout/admin-layout.phtml
Than in yout config register layouts:
'module_layouts' => [
'Web' => 'layout/web-layout',
'Admin' => 'layout/admin-layout',
],
Note: You can define each line in separate module's config: 'module_layouts' => ['Module' => 'layout/layout-name']
Wish you a very Happy New Year!