summaryrefslogtreecommitdiffstats
path: root/controllers/SearchController.php
diff options
context:
space:
mode:
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');
}
}