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'))); } } }