<div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title">Создать игру</h4> </div> <div class="modal-body"> <?php $form = ActiveForm::begin(); ?> <div class="errors-holder"></div> <div class="success-holder">Игра успешно создана</div> <div class="f-row"> <?php echo $form->field($model, 'deck_id')->dropDownList(\yii\helpers\ArrayHelper::map(\common\models\Deck::find()->all(), 'id', 'title')); ?> </div> <div class="f-row submit-row"> <?php echo Html::a(Yii::t('app', 'Создать'), '#', ['class' => 'btn btn-primary c-submit']); ?> </div> <?php ActiveForm::end(); ?> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> </div>
/** * @return \yii\db\ActiveQuery */ public function getDeck() { return $this->hasOne(Deck::className(), ['id' => 'deck_id']); }