<div class="col-lg-6"> <?php echo $form->field($model, 'tag_name_en')->textInput(); ?> </div> </div> <div class="row"> <div class="col-lg-6"> <?php echo $form->field($model, 'parent_id')->widget(Select2::className(), ['data' => Tags::getTagsList(), 'options' => ['placeholder' => 'Select parent tag..', 'multiple' => false], 'pluginOptions' => ['allowClear' => true]]); ?> </div> <div class="col-lg-6"> <?php echo $form->field($model, 'tag_type')->widget(Select2::className(), ['data' => TagType::getTagTypeList(), 'options' => ['tags' => true, 'placeholder' => 'Select tag type..', 'multiple' => false], 'pluginOptions' => ['allowClear' => true]]); ?> </div> </div> <hr> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?>
/** * @return ActiveQuery */ public function getTagType() { return $this->hasOne(TagType::className(), ['id' => 'tag_type']); }