Hello all i have tried many way for solving erroraction’s problem. But nothing that works for me. I have admin module, and i want to make erroraction for that moduleself.
My config module
<?php
class ADMINModule 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
$this->setComponents(array(
'errorHandler' => array(
// use 'site/error' action to display errors
'errorAction' => 'ADMIN/default/error',
),
'user' => array(
'class' => 'CWebUser',
)
));
parent::init();
$this->setImport(array(
'ADMIN.models.*',
'ADMIN.components.*',
'application.components.*',
));
$this->layoutPath = Yii::getPathOfAlias('ADMIN.views.layouts');
$this->layout = 'admin';
Yii::app()->user->setStateKeyPrefix("role");
Yii::app()->user->loginUrl = Yii::app()->createUrl("ADMIN/login/index");
}
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
$controller->layout = 'admin';
return true;
}
else
return false;
}
}