. * */ namespace Vvveb\Controller\Localization; use Vvveb\Controller\Listing; use Vvveb\Sql\countrySQL; class Countries extends Listing { protected $type = 'country'; protected $controller = 'country'; protected $listController = 'countries'; protected $list = 'country'; protected $module = 'localization'; function countryAutocomplete() { $country = new countrySQL(); $options = [ 'start' => 0, 'limit' => 10, 'search' => trim($this->request->get['text']), ] + $this->global; $results = $country->getAll($options); $search = []; foreach ($results['country'] as $country) { //$country['image'] = Images::image($country['image'], 'country'); $search[$country['country_id']] = $country['name']; } //echo json_encode($search); $this->response->setType('json'); $this->response->output($search); return false; } }