...HttpException
アプリケーションのログインには、ロギング エラーをスローする次のコードがあります。
// common/models/LoginForm.php which is called from the backend SiteController actionLogin method as $model = new LoginForm();
public function loginAdmin()
{
//die($this->getUser()->getRoleValue()."hhh");
if ($this->getUser()->getRoleValue() >= ValueHelpers::getRoleValue('Admin') && $this->getUser()->getStatusValue() == ValueHelpers::getStatusValue('Active')){
if ($this->validate()){
return \Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30:0);
}
else{
throw new \yii\web\NotFoundHttpException('Incorrect Password or Username.');
}
}
else{
throw new \yii\web\ForbiddenHttpException('Insufficient privileges to access this area.');
}
}
NotFoundHttpException
正常に動作していますが、とのそれぞれでレンダリングされたページをカスタマイズしたいと思いますForbiddenHttpException
。Yii2 apiを検索して、オブジェクトの構成でビューを定義する可能性のあるパラメーターを見つけようとしましたが、それが見つかりませんでした。では、例外のビューをカスタマイズする方法はありますか?