summaryrefslogtreecommitdiffstats
path: root/controllers/SearchController.php
diff options
context:
space:
mode:
authorraylu <raylu@mixpanel.com>2011-07-16 23:08:10 -0700
committerraylu <raylu@mixpanel.com>2011-07-16 23:08:10 -0700
commitdcc965ab293655136c251afe4fb6f4f41ac5cb75 (patch)
tree06d69723a766ff1bbe88f716a9a427fb397f158b /controllers/SearchController.php
parent994c36b8279480b6e3374017140e36d77401d3a4 (diff)
downloadotakuhub-dcc965ab293655136c251afe4fb6f4f41ac5cb75.tar.xz
manga/kdrama individual search pages
Diffstat (limited to 'controllers/SearchController.php')
-rw-r--r--controllers/SearchController.php18
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');
}
}