public function actionGetSearch($search) { $items = Story::findAllByQuery('SELECT * FROM news_stories WHERE lead LIKE "%' . $search . '%"'); $this->data->items = new Collection(); foreach ($items as $subkey => $subvalue) { $this->data->items[$subkey] = new Collection(); foreach ($subvalue as $subinkey => $subinvalue) { $this->data->items[$subkey][$subinkey] = $subvalue->{$subinkey}; } } }
public function actionGetSearch($search) { $items = Story::findAllByQuery('SELECT * FROM news_stories WHERE lead LIKE "%' . $search . '%"'); $this->data->items = new Collection(); foreach ($items as $subkey => $subvalue) { $this->data->items[$subkey] = new Collection(); foreach ($subvalue as $subinkey => $subinvalue) { $this->data->items[$subkey][$subinkey] = $subvalue->{$subinkey}; } } $this->data->parents = new Collection(); $this->data->parents_id = new Collection(); $this->data->parents[] = 'Все обьявления'; $this->data->parents_id[] = 1; $this->data->parents[] = 'Результат поиска ("' . $search . '")'; }