There is a search form, the first and second input I use a widget from kartik kartik\typeahead\Typeahead; .
When I try to find a tow truck, then I have a dubbing, I would like to get rid of it.
The example itself looks like:
This is a table where users retain their specialty.
controller`public function actionCategoryList($q = null) { $query = new Query(); $query->select('title') ->from('profile_has_category') ->where('title LIKE "%' . $q . '%"') ->orderBy('title'); $command = $query->createCommand(); $data = $command->queryAll(); $out = []; foreach ($data as $d) { $out[] = ['value' => $d['title']]; } echo Json::encode($out); } View
Typeahead::widget([ 'name' => 'Search[category]', 'options' => ['placeholder' => 'Искать специальности ...'], 'pluginOptions' => ['highlight' => true], 'class' => 'search-input-spec', 'dataset' => [ [ 'datumTokenizer' => "Bloodhound.tokenizers.obj.whitespace('value')", 'display' => 'value', //'prefetch' => $asset->baseUrl . '/samples/countries.json', 'remote' => [ 'url' => Url::to(['search/category-list']) . '?q=%QUERY', 'wildcard' => '%QUERY' ] ] ] ]); 
