From 2389d66da849798f8d4ec5f10e3b07c11da49185 Mon Sep 17 00:00:00 2001 From: Michael Francis Date: Sat, 28 May 2011 13:28:16 -0400 Subject: Initial Commit --- controllers/ContentController.php | 62 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 controllers/ContentController.php (limited to 'controllers/ContentController.php') 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 @@ +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 -- cgit v1.2.3