Skip to content
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

Open
varlog9000 opened this issue Jul 19, 2020 · 0 comments
Open

Не запускается виджет админки #97

varlog9000 opened this issue Jul 19, 2020 · 0 comments

Comments

@varlog9000
Copy link

Не получается запустить админку.

Модель товара 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 контейнер для него

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant