public function getModel()
 {
     $model = MetaTag::findOne(['model_id' => $this->owner->id, 'model' => (new \ReflectionClass($this->owner))->getShortName()]);
     if ($model == null) {
         $model = new MetaTag();
     }
     $this->_model = $model;
     return $model;
 }
Exemple #2
0
 public function run()
 {
     $model = new MetaTag();
     if (!$this->model->isNewRecord) {
         $meta_tag = MetaTag::findOne(['model_id' => $this->model->id, 'model' => (new \ReflectionClass($this->model))->getShortName()]);
         if (isset($meta_tag)) {
             $model = $meta_tag;
         }
     }
     return $this->render('MetaTags', ['model' => $model, 'form' => $this->form]);
 }