HummingBirdAnimeClient/app/controllers/MangaController.php

56 lines
1.0 KiB
PHP
Raw Normal View History

2015-05-27 09:03:42 -04:00
<?php
/**
* Controller for manga list
*/
2015-05-27 09:03:42 -04:00
class MangaController extends BaseController {
/**
* The manga model
* @var object $model
*/
2015-05-27 09:03:42 -04:00
private $model;
/**
* Route mapping for main navigation
* @var array $nav_routes
*/
private $nav_routes = [
'Reading' => '/',
'Plan to Read' => '/plan_to_read',
'On Hold' => '/on_hold',
'Dropped' => '/dropped',
'Completed' => '/completed',
'All' => '/all'
];
/**
* Constructor
*/
2015-05-27 09:03:42 -04:00
public function __construct()
{
parent::__construct();
$this->model = new MangaModel();
}
/**
* Get a section of the manga list
*
* @param string $status
* @param string $title
* @return void
*/
public function manga_list($status, $title)
2015-05-27 09:03:42 -04:00
{
$data = ($status !== 'all')
? [$status => $this->model->get_list($status)]
: $this->model->get_all_lists();
2015-05-27 09:03:42 -04:00
$this->outputHTML('manga/list', [
2015-05-27 09:03:42 -04:00
'title' => $title,
'nav_routes' => $this->nav_routes,
'sections' => $data
2015-05-27 09:03:42 -04:00
]);
}
}
// End of MangaController.php