move_uploaded_file(@web/upload/company/ad0e7643312a50ba3a8dcbfb8bf98b5f.jpg): failed to open stream: No such file or directory
public function actionCity($q = null)
{
$query = new Query();
$query->select('city_name')
->from('profile')
->where('city_name LIKE "%' . $q . '%"')
->groupBy('city_name')
->orderBy('city_name');
$command = $query->createCommand();
$data = $command->queryAll();
$out = [];
foreach ($data as $d) {
$out[] = ['value' => $d['city_name']];
}
echo Json::encode($out);
}
Typeahead::widget([
'name' => 'Search[city]',
'options' => ['placeholder' => 'Все города Украины ...'],
'pluginOptions' => ['highlight' => true],
'class' => 'search-input-city',
'dataset' => [
[
'datumTokenizer' => "Bloodhound.tokenizers.obj.whitespace('value')",
'display' => 'value',
//'prefetch' => $asset->baseUrl . '/samples/countries.json',
'remote' => [
'url' => Url::to(['search/city']) . '?q=%QUERY',
'wildcard' => '%QUERY'
]
]
]
]);