forked from metalagman/yii2-eav
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Не запускается виджет админки #97
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Не получается запустить админку.
Модель товара 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: