Answer the question
In order to leave comments, you need to log in
Searching data from db using YII2 form?
Hello, I have my own form with checkboxes and inputs. I want that after selecting the necessary parameters, when I click the "Show" button, I would display the necessary records from the database.
<fieldset class="search-column">
<legend>Тип жилья:</legend>
<ul class="type-checkbox">
<li>
<input type="checkbox" name="hotel" id="hotel-field" checked>
<label for="hotel-field">Гостиница</label>
</li>
<li>
<input type="checkbox" name="motel" id="motel-field" checked>
<label for="motel-field">Мотель</label>
</li>
<li>
<input type="checkbox" name="apart" id="apart-field" checked>
<label for="apart-field">Аппартаменты</label>
</li>
</ul>
</fieldset>
<div class="search-column-range">
<div class="range-title">Стоимость в сутки(Р):</div>
<div class="price-filter">
<div class="min-price">
<input type="text" name="start-price" id="start-price-field">
<label for="start-price-field">от 0</label>
</div>
<div class="max-price">
<input type="text" name="final-price" id="final-price-field">
<label for="final-price-field">до 3000</label>
</div>
</div>
<button class="show-hotels" type="submit">Показать</button>
</div>
</form>
<?php foreach ($articles as $article):?>
<img src="" alt="">
<a href="#"><?= $article->hotelname?></a>
<?= $article->type?>
От <?= $article->min_price?> Р.
<a href="#">Подробнее</a>
<a href="#">Забронировать</a>
<?php endforeach; ?>
<?php
echo LinkPager::widget([
'pagination' => $pagination,
]);
?>
Answer the question
In order to leave comments, you need to log in
Or maybe, instead of doing this nonsense, just set a placeholder?
<v-text-field
placeholder="-"
v-model="product.product.comment"
:solo="none_change"
:readonly="none_change"
></v-text-field>
I'm really bad at Yii2 and programming, so I don't really understand how using Yii2 you can connect checkboxes and inputs to the database and output data when needed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question