?> <?php echo $form->field($model, 'show_unit')->checkbox(); ?> <?php echo $form->field($model, 'type')->dropDownList(CategoryField::types()); ?> <?php echo $form->field($model, 'options')->textarea(['rows' => 6]); ?> <?php echo $form->field($model, 'group_id')->dropDownList(\yii\helpers\ArrayHelper::map(CategoryFieldGroup::find()->all(), 'id', 'title_system')); ?> <?php echo $form->field($model, 'required')->checkbox(); ?> <?php echo $form->field($model, 'hidden')->checkbox(); ?> <?php echo $form->field($model, 'sort'); ?> <?php
public function actionIndex() { $fieldGroupsDP = new ActiveDataProvider(['query' => CategoryFieldGroup::find()]); return $this->render('index', ['fieldGroupsDP' => $fieldGroupsDP]); }
<?php use yii\widgets\ActiveForm; use yii\helpers\Html; use yii\helpers\ArrayHelper; /** * @var \yii\easyii\modules\catalog\models\Category2CategoryField $model */ ?> <?php $form = ActiveForm::begin([]); echo $form->field($model, 'category_id')->dropDownList(ArrayHelper::map(\yii\easyii\modules\catalog\models\Category::find()->all(), 'id', 'title')); ?> <?php echo $form->field($model, 'field_group_id')->dropDownList(ArrayHelper::map(\yii\easyii\modules\catalog\models\CategoryFieldGroup::find()->all(), 'id', 'title_system')); ?> <?php echo Html::submitButton(Yii::t('easyii', 'Save'), ['class' => 'btn btn-primary']); ?> <?php ActiveForm::end();