From 3404aebda95c78a98e477c120354f20891f55c7b Mon Sep 17 00:00:00 2001 From: raylu Date: Sat, 16 Jul 2011 21:27:12 -0700 Subject: search page styling --- controllers/SearchController.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'controllers/SearchController.php') 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'); } } -- cgit v1.2.3