Inheritance: extends yii\base\DynamicModel
Exemple #1
0
 /**
  * @return EavModel
  */
 public function __get($name = '')
 {
     /*if (!$this->EavModel instanceof EavModel) {
     
             }*/
     $this->EavModel = EavModel::create(['entityModel' => $this->owner, 'valueClass' => $this->valueClass, 'attribute' => $name]);
     return $this->EavModel;
 }
Exemple #2
0
 private function renderField($model, $attribute, $options)
 {
     $this->adjustLabelFor($options);
     $eavModel = EavModel::create(['entityModel' => $model, 'attribute' => $attribute, 'valueClass' => \mirocow\eav\models\EavAttributeValue::className()]);
     $handler = $eavModel->handlers[$attribute];
     $handler->owner->activeForm = $options['form'];
     unset($options['form']);
     $handler->options = $options;
     /** @var EavAttribute $attributeModel */
     $attributeModel = $handler->attributeModel;
     /** @var ActiveField $model */
     $model = $handler->run();
     $model->label($attributeModel->label);
     $model->hint($attributeModel->description);
     $this->parts = $model->parts;
     /** Add required attribute */
     if ($attributeModel->required) {
         $this->options['class'] .= ' ' . $this->form->requiredCssClass;
     }
     return $this;
 }
Exemple #3
0
 /**
  * @return EavModel
  */
 public function __get($name = '')
 {
     return $this->EavModel = EavModel::create(['entityModel' => $this->owner, 'valueClass' => $this->valueClass, 'attribute' => $name]);
 }