By default, the view being displayed is specified via the view GET parameter. The name of the GET parameter can be customized via [[viewParam]]. Users specify a view in the format of path/to/view, which translates to the view name ViewPrefix/path/to/view where ViewPrefix is given by [[viewPrefix]]. The view will then be rendered by the [[\yii\base\Controller::render()|render()]] method of the currently active controller. Note that the user-specified view name must start with a word character and can only contain word characters, forward slashes, dots and dashes.
Since: 2.0
Author: Alexander Makarov (sam@rmcreative.ru)
Author: Qiang Xue (qiang.xue@gmail.com)
Inheritance: extends yii\base\Action
Exemplo n.º 1
0
 public function init()
 {
     parent::init();
     $this->battle = null;
     if ($user = Yii::$app->user->identity) {
         $this->battle = Battle::findOne(['id' => Yii::$app->request->get('battle'), 'user_id' => $user->id]);
     }
 }
 public function actions()
 {
     return ['error' => ['class' => 'yii\\web\\ErrorAction'], 'captcha' => ['class' => CaptchaAction::className(), 'fixedVerifyCode' => YII_ENV_DEV ? '5555' : false, 'algorithm' => function () {
         $algo = new Numbers();
         $algo->minLength = 4;
         $algo->maxLength = 4;
         return $algo;
     }], 'page' => ['class' => ViewAction::className(), 'viewPrefix' => 'pages/' . \Yii::$app->language]];
 }
Exemplo n.º 3
0
 public function init()
 {
     $this->previousLanguage = Yii::$app->language;
     Yii::$app->language = 'en-US';
     parent::init();
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ['error' => ['class' => ErrorAction::className()], 'about' => ['class' => ViewAction::className(), 'defaultView' => 'about']];
 }
Exemplo n.º 5
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ['error' => ['class' => 'yii\\web\\ErrorAction'], 'captcha' => ['class' => 'yii\\captcha\\CaptchaAction', 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, 'minLength' => 1, 'maxLength' => 4, 'fontFile' => '@yii/captcha/BOTTF.TTF', 'offset' => 2], 'icon' => ['class' => ViewAction::className()]];
 }
Exemplo n.º 6
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ['error' => ['class' => ErrorAction::className()], 'about' => ['class' => ViewAction::className(), 'defaultView' => 'about'], 'captcha' => ['class' => CaptchaAction::className(), 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, 'backColor' => 0xf5f5f5, 'height' => 34]];
 }
Exemplo n.º 7
0
 /**
  * @return bool
  */
 protected function beforeRun()
 {
     if (parent::beforeRun()) {
         $this->_initBreadcrumbsData();
         $this->_initActionsData();
         $this->_initMetadata();
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 8
0
 public function init()
 {
     $this->previousTimezone = Yii::$app->timeZone;
     parent::init();
 }
Exemplo n.º 9
0
 public function init()
 {
     parent::init();
     Yii::$app->controller->enableCsrfValidation = false;
     $this->registerTranslations();
 }
Exemplo n.º 10
0
 public function actions()
 {
     return ['error' => ['class' => ErrorAction::className()], 'page' => ['class' => ViewAction::className()]];
 }
Exemplo n.º 11
0
 public function actions()
 {
     return ['view' => ['class' => \yii\web\ViewAction::className()]];
 }
Exemplo n.º 12
0
 public function init()
 {
     $r = parent::init();
     $this->doInit();
     return $r;
 }
Exemplo n.º 13
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ['error' => ['class' => ErrorAction::className()], 'about' => ['class' => ViewAction::className(), 'defaultView' => 'about'], 'language' => ['class' => 'fourteenmeister\\site\\action\\Language', 'languages' => array_keys(Yii::$app->params['availableLanguages'])]];
 }