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.
부터: 2.0
저자: Alexander Makarov (sam@rmcreative.ru)
저자: Qiang Xue (qiang.xue@gmail.com)
상속: extends yii\base\Action
예제 #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]];
 }
예제 #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']];
 }
예제 #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()]];
 }
예제 #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]];
 }
예제 #7
0
파일: AdminAction.php 프로젝트: Liv1020/cms
 /**
  * @return bool
  */
 protected function beforeRun()
 {
     if (parent::beforeRun()) {
         $this->_initBreadcrumbsData();
         $this->_initActionsData();
         $this->_initMetadata();
         return true;
     } else {
         return false;
     }
 }
예제 #8
0
 public function init()
 {
     $this->previousTimezone = Yii::$app->timeZone;
     parent::init();
 }
예제 #9
0
 public function init()
 {
     parent::init();
     Yii::$app->controller->enableCsrfValidation = false;
     $this->registerTranslations();
 }
예제 #10
0
 public function actions()
 {
     return ['error' => ['class' => ErrorAction::className()], 'page' => ['class' => ViewAction::className()]];
 }
예제 #11
0
 public function actions()
 {
     return ['view' => ['class' => \yii\web\ViewAction::className()]];
 }
예제 #12
0
 public function init()
 {
     $r = parent::init();
     $this->doInit();
     return $r;
 }
 /**
  * @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'])]];
 }