I'm trying to implement a search with autocomplete using the Typeahead Basic widget. There is a Products model in the database, where the name field needs to be searched. No widget was selected without ActiveForm .

 $productModel = new \app\models\Products(); echo TypeaheadBasic::widget([ 'model' => $productModel, 'attribute' => 'name', 'dataset' => [ 'limit' => 6, 'templates' => [ 'notFound' => '<div class="text-danger" style="padding:10px 10px">Nothing found</div>', ] ], 'data' => $data, 'options' => ['placeholder' => 'Find ...'], 'pluginOptions' => ['highlight'=>true], ]); 

In the $ data array, all the name products. Is it possible, for example in $ data, to transfer not only the values ​​of one name field for searching, but to completely transfer records with all fields, to do a search only across the name field and to display another amount field in the autocomplex along with the name field? such as Sugar 250gr
And tell me how to get the results that were derived autocomplete?

    0