You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Модель товара MainProduct
Прописал в модели поведениях: 'eav' => [ 'class' => EavBehavior::class, // это модель для таблицы object_attribute_value 'valueClass' => EavAttributeValue::class, ]
прописал метод поиска атрибутов: public function getEavAttributes() { return EavAttribute::find() ->joinWith( 'entity' ) ->where( [ 'eav_attribute.categoryId' => $this->category_id, 'entityModel' => MainProduct::class ] ); }
В модели категории MainCatergory прописал в поведениях: 'eav' => [ 'class' => EavBehavior::class, // это модель для таблицы object_attribute_value 'valueClass' => EavAttributeValue::class, ]
метод поиска атрибутов: public function getEavAttributes() { return \mirocow\eav\models\EavAttribute::find() ->joinWith('entity') ->where([ 'eav_attribute.categoryId' => $this->id, 'entityModel' => MainProduct::class ]); }
В представлении категории добавляю виджет для редактирования <?php echo Fields::widget([ 'model' => $model, 'categoryId' => $model->id, 'entityName' => $model->name, 'entityModel' => MainProduct::class, // ваша модель для которой подключено расширение ])?>
, но виджет редактора не выводится, есть только div контейнер для него
The text was updated successfully, but these errors were encountered:
Не получается запустить админку.
Модель товара MainProduct
Прописал в модели поведениях:
'eav' => [ 'class' => EavBehavior::class, // это модель для таблицы object_attribute_value 'valueClass' => EavAttributeValue::class, ]
прописал метод поиска атрибутов:
public function getEavAttributes() { return EavAttribute::find() ->joinWith( 'entity' ) ->where( [ 'eav_attribute.categoryId' => $this->category_id, 'entityModel' => MainProduct::class ] ); }
В модели категории MainCatergory прописал в поведениях:
'eav' => [ 'class' => EavBehavior::class, // это модель для таблицы object_attribute_value 'valueClass' => EavAttributeValue::class, ]
метод поиска атрибутов:
public function getEavAttributes() { return \mirocow\eav\models\EavAttribute::find() ->joinWith('entity') ->where([ 'eav_attribute.categoryId' => $this->id, 'entityModel' => MainProduct::class ]); }
В общих настройках прописал в компонентах:
'i18n' => [ 'translations' => [ 'app*' => [ 'class' => 'yii\i18n\PhpMessageSource', //'basePath' => '@app/messages', //'sourceLanguage' => 'en-US', 'fileMap' => [ 'app' => 'app.php', 'app/error' => 'error.php', ], ], 'eav' => [ 'class' => 'yii\i18n\PhpMessageSource', 'basePath' => '@mirocow/eav/messages', ], ], ],
в модулях:
'eav' => [ 'class' => 'mirocow\eav\Module', ],
В представлении категории добавляю виджет для редактирования
<?php echo Fields::widget([ 'model' => $model, 'categoryId' => $model->id, 'entityName' => $model->name, 'entityModel' => MainProduct::class, // ваша модель для которой подключено расширение ])?>
, но виджет редактора не выводится, есть только div контейнер для него
The text was updated successfully, but these errors were encountered: