It means so.

There is an admin on yii.

The login form to the admin panel is loaded, provided that the user is not authorized. at authorization we throw it on the necessary page.

Heed the Question!

I have several layouts, one is the login form to the admin area. The second layout is the admin template itself. And so

Is it necessary to prescribe the layout I need before each render? or can you do something else?

$this->layout="/layouts/main"; $this->render('contact',array('model'=>$model)); 

// upd and still some help is needed.

    1 answer 1

    The presence of a layout is checked in order of priority:

    • First in CController::$layout
    • Then, if a module is used, in CWebModule::$layout
    • And last but not least in CWebApplication::$layout

    Accordingly, if your admin panel is placed in a separate module, you can set the layout in the module, otherwise in the corresponding controller and redefine it only when displaying the input form.

    • Well, good thanks and respectos :) the crap has become 5 lines less. - Artem