diff options
author | raylu <raylu@mixpanel.com> | 2011-07-16 21:27:12 -0700 |
---|---|---|
committer | raylu <raylu@mixpanel.com> | 2011-07-16 21:27:12 -0700 |
commit | 3404aebda95c78a98e477c120354f20891f55c7b (patch) | |
tree | c00b0f0ff1c47f9134bc6987a7e3bcfea53a7aca /controllers/SearchController.php | |
parent | 30bd3dc2c8e1dea9fb394115138f4f5ef9aedc33 (diff) | |
download | otakuhub-3404aebda95c78a98e477c120354f20891f55c7b.tar.xz |
search page styling
Diffstat (limited to 'controllers/SearchController.php')
-rw-r--r-- | controllers/SearchController.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/controllers/SearchController.php b/controllers/SearchController.php index 805b981..0052992 100644 --- a/controllers/SearchController.php +++ b/controllers/SearchController.php @@ -11,16 +11,15 @@ class SearchController extends \lithium\action\Controller { public function index() { if (isset($this->request->query['q'])) { - $q = '/' . $this->request->query['q'] . '/i'; - $conditions = array('title' => array('like' => $q)); - $limit = 10; - + $q = $this->request->query['q']; + $conditions = array('title' => array('like' => "/$q/i")); + $limit = 7; $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 compact('q', 'anime', 'manga', 'kdrama'); } } |