From dcc965ab293655136c251afe4fb6f4f41ac5cb75 Mon Sep 17 00:00:00 2001 From: raylu Date: Sat, 16 Jul 2011 23:08:10 -0700 Subject: manga/kdrama individual search pages --- controllers/SearchController.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'controllers') diff --git a/controllers/SearchController.php b/controllers/SearchController.php index abcaabd..efd25f3 100644 --- a/controllers/SearchController.php +++ b/controllers/SearchController.php @@ -25,8 +25,22 @@ class SearchController extends \lithium\action\Controller { public function anime($by = 'title') { - $q = isset($this->request->query['q']) ? '/' . $this->request->query['q'] . '/i' : ''; + $q = isset($this->request->query['q']) ? $this->request->query['q'] : ''; $page = isset($this->request->query['page']) ? $this->request->query['page'] : 1; - return Anime::search($q, $page, 'title'); + return Anime::search("/$q/i", $page, 'title'); + } + + public function manga($by = 'title') + { + $q = isset($this->request->query['q']) ? $this->request->query['q'] : ''; + $page = isset($this->request->query['page']) ? $this->request->query['page'] : 1; + return Manga::search("/$q/i", $page, 'title'); + } + + public function kdrama($by = 'title') + { + $q = isset($this->request->query['q']) ? $this->request->query['q'] : ''; + $page = isset($this->request->query['page']) ? $this->request->query['page'] : 1; + return Kdrama::search("/$q/i", $page, 'title'); } } -- cgit v1.2.3