alpa_s

Untitled

Nov 15th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1.     public function beforeAction($action)
  2.     {
  3.         if ($action->id == 'send-contact-form' || $action->id == 'contact-validate') {
  4.             $this->enableCsrfValidation = false;
  5.         } elseif ($action->id == 'error') {
  6.             $theme = 'color';
  7.             Yii::$app->view->theme = new Theme([
  8.                 'basePath' => '@frontend/themes/' . $theme,
  9.                 'baseUrl' => '@web/themes/' . $theme,
  10.                 'pathMap' => [
  11.                     '@app/views' => '@frontend/themes/' . $theme . '/views',
  12.                     '@app/widgets' => '@frontend/themes/' . $theme . '/widgets',
  13.                 ]]);
  14.             Yii::setAlias('@theme', Yii::$app->view->theme->basePath);
  15.             $this->layout = 'conference';
  16.         }
  17.         return parent::beforeAction($action); // TODO: Change the autogenerated stub
  18.     }
Add Comment
Please, Sign In to add comment