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 init() { //Если название не задано, покажем что нибудь. if (!$this->name) { $this->name = Inflector::humanize($this->id); } if (!$this->controller instanceof AdminController) { throw new InvalidParamException(\Yii::t('app', 'This action is designed to work with the controller: ') . AdminController::className()); } $this->defaultView = $this->id; if ($this->viewName) { $this->defaultView = $this->viewName; } parent::init(); }
public function init() { $this->previousLanguage = Yii::$app->language; Yii::$app->language = 'en-US'; parent::init(); }
public function init() { $this->previousTimezone = Yii::$app->timeZone; parent::init(); }
public function init() { parent::init(); Yii::$app->controller->enableCsrfValidation = false; $this->registerTranslations(); }
public function init() { $r = parent::init(); $this->doInit(); return $r; }