public function beforeAction($action) { if ($this->content) { if ($this->content->name_meny) { $this->name = $this->content->name_meny; } else { $this->name = $this->content->name; } } return parent::beforeAction($action); }