diff options
Diffstat (limited to 'controllers')
-rw-r--r-- | controllers/SearchController.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/controllers/SearchController.php b/controllers/SearchController.php index 421efb6..a7b0cee 100644 --- a/controllers/SearchController.php +++ b/controllers/SearchController.php @@ -12,9 +12,17 @@ class SearchController extends \lithium\action\Controller { if (isset($this->request->query['q'])) { $q = '/' . $this->request->query['q'] . '/i'; - return Anime::search($q, $page, 'title'); + $conditions = array('title' => array('like' => $q)); + $limit = 10; + + + $anime = Anime::find('all', compact('conditions', 'limit')); + $manga = Manga::find('all', compact('conditions', 'limit')); + $kdrama = Kdrama::find('all', compact('conditions', 'limit')); + + return compact('anime', 'manga', 'kdrama'); + } - return $this->render(array('template' => 'index')); } public function anime($by = 'title') |