/** * @return \yii\db\ActiveQuery */ public function getFeaturesFks() { return $this->hasMany(Features::className(), ['id' => 'features_fk'])->viaTable('hotel_features', ['hotel_fk' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getFeaturesFk() { return $this->hasOne(Features::className(), ['id' => 'features_fk']); }
?> <?php //$form->field($model, 'modified')->textInput(); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => 255]); ?> <?php echo $form->field($model, 'cusine')->dropDownList(ArrayHelper::merge([0 => 'Select'], ArrayHelper::map(\app\models\Cuisine::find()->andWhere(['status' => 1])->All(), 'Id', 'name'))); ?> <?php echo $form->field($model, 'feature')->dropDownList(ArrayHelper::merge([0 => 'Select'], ArrayHelper::map(\app\models\Features::find()->andWhere(['status' => 1])->All(), 'Id', 'name'))); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end();