Action for create an object::view
<?php
if(!$model->isNewRecord) $model->getEavAttributes();
foreach (['attr1', 'attr2', 'attr3'] as $name){?>
<?= $form->textAreaGroup($model,'eavAttributes['.$name.']', array('widgetOptions'=>array(
'htmlOptions'=>array('rows'=>6, 'cols'=>50)
))); ?>
<?}?>
calling this:
public function loadEavAttributes($attributes)
and now we have smth like this on empty object primary key (new entity adding):
SELECT * FROM `project_eav` `t` WHERE (object_id = ) AND (attribute IN (:ycp0, :ycp1, :ycp2))
The solution is to fix EEavBehavior:
public function loadEavAttributes($attributes) {
if(is_null($this->getModelId())){ //[+]
return $this->getOwner(); //[+]
} //[+]
Action for create an object::view
calling this:
and now we have smth like this on empty object primary key (new entity adding):
The solution is to fix EEavBehavior: