use common\models\Village; use common\models\DateReadyDistrict; use kartik\file\FileInput; /* @var $this yii\web\View */ /* @var $model common\models\District */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="district-form"> <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?> <?php echo $form->field($model, 'village_id')->dropDownList(ArrayHelper::map(Village::find()->all(), 'id', 'name'), ['prompt=' > '- Choose Your Permissions -']); ?> <?php echo $form->field($model, 'number')->textInput(); ?> <?php echo $form->field($model, 'size')->textInput(); ?> <?php echo $form->field($model, 'price')->textInput(); ?> <?php
</form> </div> <div class="filter_box"> <h4>Поиск по характеристикам</h4> <form method="get"> <div class="filter_elements">Посёлки <div class="filter_village"> <?php $villages = ArrayHelper::map(Village::find()->all(), 'id', 'name'); ?> <?php echo Html::checkboxList('village_id', $village, $villages, ['itemOptions' => ['class' => 'selection_checkbox']]); ?> </div> </div> <div class="filter_elements price_range">Цена, тыс.руб. <input type="text" class="range" value="" name="price"> <div class="count_range_box"> <input type="text" class="size-from count_range" value="<?php echo $prices[0]; ?>
public function getVillage() { return $this->hasOne(Village::className(), ["id" => "village_id"]); }