public function init() { if (!$this->name) { $this->name = Inflector::humanize($this->id); } if (!$this->controller instanceof UserController) { throw new InvalidParamException(\Yii::t('app', 'This action is designed to work with: {controller}', ['controller' => UserController::className()])); } $this->defaultView = $this->id; if ($this->viewName) { $this->defaultView = $this->viewName; } parent::init(); }