/**
  * Creates the controller and performs the specified action.
  * @param string $route the route of the current request. See {@link createController} for more details.
  * @throws CHttpException if the controller could not be created.
  */
 public function runController($route)
 {
     try {
         parent::runController($route);
     } catch (CHttpException $x) {
         if (\Yii::app()->params['site']['logError404']) {
             \Yii::import('admin.models.BadUrlLog');
             if (!\BadUrlLog::saveLog()) {
                 throw $x;
             }
             // Si tout va bien, on enregistre l'erreur sans envoyer de mail à l'administrateur
             // On redirige le client vers la page d'erreur personnalisée
             \Yii::import('admin.*');
             /** @var \AdminModule $adminModule */
             $adminModule = \Yii::app()->getModule('admin');
             $this->runController($adminModule->routeFor404ErrorPage);
         } else {
             throw $x;
         }
     }
 }
示例#2
0
 /**
  * Méthode appelée quand une action est introuvable.
  * @internal Pour traiter le cas d'un module ou d'un contrôleur introuvables, cf. BaseWebApplication
  * @param string $actionID
  */
 public function missingAction($actionID)
 {
     if (\Yii::app()->params['site']['logError404']) {
         \Yii::import('admin.models.BadUrlLog');
         if (!\BadUrlLog::saveLog()) {
             parent::missingAction($actionID);
         }
         // Si tout va bien, on enregistre l'erreur sans envoyer de mail à l'administrateur
         // On redirige le client vers la page d'erreur personnalisée
         \Yii::import('admin.*');
         /** @var \AdminModule $adminModule */
         $adminModule = \Yii::app()->getModule('admin');
         $this->forward($adminModule->routeFor404ErrorPage);
     } else {
         parent::missingAction($actionID);
     }
 }