Answer the question
In order to leave comments, you need to log in
Single line search YII2?
There is a model "organization" with fields "name", "country", "city". How to do a single line search with typeahead attached?
Gii generates _search by default
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<ul>
<li> <?= $form->field($model, 'name') ?></li>
<li> <?= $form->field($model, 'country') ?></li>
<li><?= $form->field($model, 'city') ?></li>
<li> <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn-u']) ?></li>
<li> <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn-u']) ?></li>
</ul>
<?php ActiveForm::end(); ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question