Esempio 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]);
     }
 }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
 public function init()
 {
     $this->previousLanguage = Yii::$app->language;
     Yii::$app->language = 'en-US';
     parent::init();
 }
Esempio n. 4
0
 public function init()
 {
     $this->previousTimezone = Yii::$app->timeZone;
     parent::init();
 }
Esempio n. 5
0
 public function init()
 {
     parent::init();
     Yii::$app->controller->enableCsrfValidation = false;
     $this->registerTranslations();
 }
Esempio n. 6
0
 public function init()
 {
     $r = parent::init();
     $this->doInit();
     return $r;
 }