About the layout

In my project, some of the pages dose not need the layout ,and some dose need the layout page! All of my web pages are in the same host, how can I do with it in yii? Can somebody tell me some advice??? Thank you!

on which page you dont need a layout then you can set a layout= " " in their respective actions.

let it try.


You can find more here: http://www.yiiframework.com/doc/guide/1.1/en/basics.view

If you want e.g. 2 Layouts (one for each Controller, lets say GreenController.php and BlackController.php) you

will find a line in each Controller like this


public $layout='//layouts/column2';


change ist to

public $layout=’//layouts/green_column2’;


public $layout=’//layouts/black_column2’;

In view/layouts/ you can duplicate column2.php to green_column2.php and black_column2.php

that’s it