My favorites | Sign in
Project Logo
yii
             
New issue | Search
for
| Advanced search | Search tips
Issue 382: Layout resolution should be better designed
5 people starred this issue and may be notified of changes. Back to list
Status:  Assigned
Owner:  qiang.xue
Priority-Medium
Type-Enhancement
Milestone-1.1.0


Sign in to add a comment
 
Reported by qiang.xue, Jun 17, 2009
We should introduce the concept of search path (or the so-called cascading
search):

1. If a theme is used, the layout should be searched under the theme first.
If not found, it should proceed to the next.

2. A list of search paths should be built in the following order: 1st-level
parent module layout path, 2nd-level parent module layout path, ...,
application layout path.

3. A view/layout name starting with a slash should always refer to the
parent module's view path.

More consideration is needed regarding the "default layout" concept used by
the content decorator widget.

Comment 1 by qiang.xue, Sep 29, 2009
(No comment was entered for this change.)
Labels: -Milestone-1.1a Milestone-1.1b
Comment 2 by jerryab...@gmail.com, Oct 15, 2009
I created something *similar* in my extension library's base controller class. It's a
boolean called autoLayout. If enabled, the controller will look for a layout with the
same name as the ID of the controller. If found, it will be set:

//	Find layout...
if ( $this->m_bAutoLayout ) if (
file_exists(Yii::app()->getBasePath().'/views/layouts/'.$this->getId().'.php') )
$this->layout = $this->getId();

Full code attached.

CPSController.php
13.8 KB   Download
Comment 3 by qiang.xue, Nov 01, 2009
(No comment was entered for this change.)
Labels: -Milestone-1.1b Milestone-1.1rc
Comment 4 by qiang.xue, Dec 13, 2009
(No comment was entered for this change.)
Labels: Milestone-1.1.0
Sign in to add a comment

Hosted by Google Code