how to create another layout

I want to redirect to a page when javascript is disabled

in layout main.php:


    &lt;?php echo CHtml::metaTag('0;url='.CHtml::normalizeUrl(array('login/nojavascript')),null,'refresh'); ?&gt;


but redirect recursive occurs

how to avoid it and how to create another layout to display login/nojavascript page only

you can redirect to a url like login/nojavascript&nojs=1

and in your controller init or __construct u can put

if(isset($_REQUEST['nojs'])&&$_REQUEST['nojs']==1) $this->layout = 'nojslayout';


but nojslayout means ? another file like main.php in layouts folder

yes, exactly.

Another idea

renderPartial is enough without creating another layout