public function getCategory() { return $this->hasOne(Category::className(), ['category_id' => 'category_id'])->viaTable('easyii_article_item_category', ['item_id' => 'item_id'], function ($query) { $query->where('`order`=0'); }); return $this->getItemCategories()->alias('main_category')->on('main_category.order=0'); }
?> <?php echo $form->field($model, 'text')->widget(Redactor::className(), ['options' => ['minHeight' => 400, 'imageUpload' => Url::to(['/admin/redactor/upload', 'dir' => 'article'], true), 'fileUpload' => Url::to(['/admin/redactor/upload', 'dir' => 'article'], true), 'plugins' => ['fullscreen']]]); ?> <?php echo $form->field($model, 'time')->widget(DateTimePicker::className()); ?> <?php echo ''; ?> <?php echo $form->field($model, 'categoryIds')->widget(SelectizeDropDownList::className(), ['options' => ['multiple' => true], 'items' => ArrayHelper::map(Category::find()->all(), 'category_id', 'title')]); ?> <?php if ($this->context->module->settings['enableTags']) { ?> <?php echo $form->field($model, 'tagNames')->widget(TagsInput::className()); ?> <?php } ?> <?php if (IS_ROOT) { ?>