Hello guys, I found some extra explanations about theming in topics.
I have a module called "rbac". I want this module to use a theme called "administrator".
Inside my module, I have a controller called "user". In my init() method i have:
Yii::app()->setTheme('administrator');
I have already printed out my theme object and it was there with my basepath, theme name and etc…but my view doesnt change.
My theme path:
–views
—rbac
----layouts
-----main.php
Someone could help me? I need it too much.
Ok.
I have tried this in config/main :
'modules'=>array('usuarios','rbac'),
'theme'=>'administrador',
And nothing have changed.
After this I tried:
class UsuariosModule extends CWebModule
{
public function init()
{
// this method is called when the module is being created
// you may place code here to customize the module or the application
// import the module-level models and components
Yii::app()->setTheme('administrador');
$this->setImport(array(
'usuarios.models.*',
'usuarios.components.*',
));
}
public function beforeControllerAction($controller, $action)
{
if(parent::beforeControllerAction($controller, $action))
{
// this method is called before any module controller action is performed
// you may place customized code here
return true;
}
else
return false;
}
}
And nothing again