diff options
author | Michael Francis <edude03@gmail.com> | 2011-07-17 20:38:31 -0400 |
---|---|---|
committer | Michael Francis <edude03@gmail.com> | 2011-07-17 20:38:31 -0400 |
commit | c9994190d2ba584e1eb95b6b47ff586da7b0f29f (patch) | |
tree | ff4d02327f8e988925036f7406c760dfba8791d3 /controllers/SearchController.php | |
parent | 7be960630a8c0b4dab94245c73453b22db3f305e (diff) | |
parent | 2baaf56e140a06eed8fe0b1d28d744d34a537d49 (diff) | |
download | otakuhub-c9994190d2ba584e1eb95b6b47ff586da7b0f29f.tar.xz |
Merge branch 'master' of git.raylu.net:otakuhub
Diffstat (limited to 'controllers/SearchController.php')
-rw-r--r-- | controllers/SearchController.php | 18 |
1 files changed, 16 insertions, 2 deletions
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'); } } |