summaryrefslogtreecommitdiffstats
path: root/controllers
diff options
context:
space:
mode:
authorraylu <raylu@mixpanel.com>2011-07-16 21:27:12 -0700
committerraylu <raylu@mixpanel.com>2011-07-16 21:27:12 -0700
commit3404aebda95c78a98e477c120354f20891f55c7b (patch)
treec00b0f0ff1c47f9134bc6987a7e3bcfea53a7aca /controllers
parent30bd3dc2c8e1dea9fb394115138f4f5ef9aedc33 (diff)
downloadotakuhub-3404aebda95c78a98e477c120354f20891f55c7b.tar.xz
search page styling
Diffstat (limited to 'controllers')
-rw-r--r--controllers/SearchController.php11
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');
}
}