Wednesday, March 07, 2012

Adding your own layout for yii-user-management

http://www.yiiframework.com/extension/yii-user-management/

If you want to use your own layout for yii-user-management extension, you can go to the following location

app folder/modules/user/UserModule.php

and modify these two lines.

public $loginLayout = 'application.modules.user.views.layouts.yum';
public $adminLayout = 'application.modules.user.views.layouts.yum';


For me, I created a new theme, so I specified it as below.

Add this on top of the page:
Yii::setPathOfAlias('YumThemes' , dirname(Yii::app()->request->scriptFile).'/themes/my_theme/');

public $loginLayout = 'YumThemes.views.layouts.yum_layout';
public $adminLayout = 'YumThemes.views.layouts.yum_layout';

Then, you can go to www/theme/my_theme/views/layouts/yum_layout.php and modify yum_layout.php to modify the layout for the login and the admin layout. ^^

I think I forgot to mention that you also need to change $baseLayout as a base layout.

1 comment:

Unknown said...

Wonder full bradar....