2015-05-22 12:36:26 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class AnimeController extends BaseController {
|
|
|
|
|
|
|
|
private $model;
|
2015-06-09 18:18:53 -04:00
|
|
|
private $collection_model;
|
2015-05-22 12:36:26 -04:00
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
$this->model = new AnimeModel();
|
2015-06-09 18:18:53 -04:00
|
|
|
$this->collection_model = new AnimeCollectionModel();
|
2015-05-22 12:36:26 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function index()
|
|
|
|
{
|
|
|
|
$this->anime_list('currently-watching');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function all()
|
|
|
|
{
|
|
|
|
$data = $this->model->get_all_lists();
|
|
|
|
$this->outputHTML('anime_list', [
|
|
|
|
'title' => "Tim's Anime List · All",
|
|
|
|
'sections' => $data
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function anime_list($type, $title="Tim's Anime List")
|
|
|
|
{
|
|
|
|
$data = $this->model->get_list($type);
|
|
|
|
$this->outputHTML('anime_list', [
|
|
|
|
'title' => $title,
|
|
|
|
'sections' => $data
|
|
|
|
]);
|
|
|
|
}
|
2015-05-27 09:03:42 -04:00
|
|
|
|
2015-06-09 18:18:53 -04:00
|
|
|
public function collection()
|
|
|
|
{
|
2015-06-11 12:54:54 -04:00
|
|
|
$data = $this->collection_model->get_collection();
|
2015-06-09 18:18:53 -04:00
|
|
|
|
2015-06-11 12:54:54 -04:00
|
|
|
$this->outputHTML('anime_collection', [
|
2015-06-09 18:18:53 -04:00
|
|
|
'title' => "Tim's Anime Collection",
|
2015-06-11 12:54:54 -04:00
|
|
|
'sections' => $data
|
2015-06-09 18:18:53 -04:00
|
|
|
]);
|
|
|
|
}
|
2015-05-22 12:36:26 -04:00
|
|
|
}
|
|
|
|
// End of AnimeController.php
|