Hi,
I'm building and application using different modules. I found that I need to copy the layout files into the views directory for each module.
I would like to know how to use single layout file shared between all the modules.
Thanks
Page 1 of 1
Sharing layout between modules
#2
Posted 13 March 2010 - 11:14 AM
It's called the application layout, and you can find it in views/layouts/main.php by default.
If you mean you need to render a module's own layout so it looks like being inside the application layout, thus respecting the nestingness of the module, you may consider using the project "yii-modules" I just started yesterday as a starting point. It's not stable yet, and things may change a lot, but here's the announcing thread: http://www.yiiframew...-on-top-of-yii/
Your controllers will only need to inherit "Controller" instead of CController, and you'll have to call Controller::renderParents() instead of CController::render().
BUT PLEASE, please read the announcing thread carefully.
If you mean you need to render a module's own layout so it looks like being inside the application layout, thus respecting the nestingness of the module, you may consider using the project "yii-modules" I just started yesterday as a starting point. It's not stable yet, and things may change a lot, but here's the announcing thread: http://www.yiiframew...-on-top-of-yii/
Your controllers will only need to inherit "Controller" instead of CController, and you'll have to call Controller::renderParents() instead of CController::render().
BUT PLEASE, please read the announcing thread carefully.
Share this topic:
Page 1 of 1

Help











