summaryrefslogtreecommitdiffstats
path: root/controllers/ContentController.php
diff options
context:
space:
mode:
authorMichael Francis <edude03@gmail.com>2011-05-28 13:28:16 -0400
committerMichael Francis <edude03@gmail.com>2011-05-28 13:28:16 -0400
commit2389d66da849798f8d4ec5f10e3b07c11da49185 (patch)
treee22556d12982395b469a23420c662662e3e064cc /controllers/ContentController.php
downloadotakuhub-2389d66da849798f8d4ec5f10e3b07c11da49185.tar.xz
Initial Commit
Diffstat (limited to 'controllers/ContentController.php')
-rw-r--r--controllers/ContentController.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/controllers/ContentController.php b/controllers/ContentController.php
new file mode 100644
index 0000000..688c2a8
--- /dev/null
+++ b/controllers/ContentController.php
@@ -0,0 +1,62 @@
+<?php
+
+namespace app\controllers;
+use app\models\anime;
+
+class ContentController extends \lithium\action\Controller {
+ public $publicActions = array('anime');
+
+ public function index($type) //type has to equal something
+ {
+
+
+
+ switch($type) {
+ case "anime": $content = Anime::all(compact('limit','page','order'));
+ $total = Anime::count();
+ break;
+
+ case "manga":
+
+ case "kdrama": $content = Kdrama::all(compact('limit', 'page', 'order'));
+ $total = Kdrama::count();
+ break;
+ }
+
+ return compact('content', 'total', 'page', 'limit');
+ }
+
+ public function manga($id = null)
+ {
+ if ($id != null)
+ {
+
+ }
+ else
+ {
+ $content = Manga::all(compact('limit', 'page', 'order'));
+ $total = Manga::count();
+ }
+ }
+
+ public function anime($id = null)
+ {
+ $limit = 20;
+ $page = $this->request->page ?: 1;
+ $order = array('title' => 'ASC');
+ $content;
+ $total;
+
+ if ($id != null)
+ {
+ $content = Anime::find('first', array('conditions' => array('special_id' => $id), 'order' => array('title' => 'ASC')));
+ return compact('content');
+ }
+ else
+ {
+ $content = Anime::all(compact('limit','page','order'));
+ $total = Anime::count();
+ $this->render(array('template' => 'index', 'data' => compact('limit', 'page', 'content', 'total')));
+ }
+ }
+} \ No newline at end of file