layout 3 column in yii

hi, can anyone tell me how to make my web application shows 3 column layout in every page?

what kind of file should i change?


create a protected/views/layouts/column3.php file copying the column2.php

then change in the controller

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

You need to add a column3.php file to the layouts folder - see attached screenshot. Then you need to add

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

to your controllers that will use this layout.

To use the 3 column file as the default, change to Controller file (in the Protected/components folder) to point to the new layout -

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




On the same subject.

I want a side nav but only on a single action and not on the controller level

I have tried this but don’t work.

public function actionLogin(){

	$this->layout = 'column1';


any ideas ?

Sorry guys, my mistake.

I forgot to include the //layouts/

public function actionLogin(){

        $this->layout = '//layouts/column1';


It works fine now.