public function beforeAction($action)
 {
     if ($content_id = \Yii::$app->request->get('content_id')) {
         $this->content = CmsContent::findOne($content_id);
     }
     if ($this->content) {
         if ($this->content->name_meny) {
             $this->name = $this->content->name_meny;
         }
     }
     return parent::beforeAction($action);
 }
Example #2
0
 public function beforeAction($action)
 {
     $this->model = \Yii::$app->user->identity;
     return parent::beforeAction($action);
 }
 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);
 }