Last active
January 16, 2019 07:48
-
-
Save YasinPatel/09767f24617b6911c845f1b2ec9e43e3 to your computer and use it in GitHub Desktop.
Module wise Error Page in Yii2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Yii::$app->errorHandler->errorAction = 'studconsult/default/error'; | |
<?php | |
namespace app\modules\admin; | |
class Module extends \yii\base\Module | |
{ | |
public $controllerNamespace = 'app\modules\admin\controllers'; | |
public function init() | |
{ | |
parent::init(); | |
Yii::$app->errorHandler->errorAction = 'admin/default/error'; // add this line | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need to add
use Yii;
after namespace.