Yii Framework Forum: Sharing layout between modules - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Sharing layout between modules Rate Topic: -----

#1 User is offline   TAQTICA 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 13-February 10

Posted 13 March 2010 - 10:50 AM

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
0

#2 User is offline   OriginalCopy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 63
  • Joined: 13-March 09

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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users