summaryrefslogtreecommitdiffstats
path: root/controllers/AnimeController.php
blob: 3e0c51d09f6866a039de91f4b0df7a785aef2677 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

namespace app\controllers;

use app\models\Anime;

class AnimeController extends \lithium\action\Controller {
	public $publicActions = array('index', 'view');

	public function index()
	{
		$page = $this->request->query['page'];
		return Anime::search(null, $page, null);
	}

	public function view($id = null)
	{
		if (is_numeric($id)) {
			return Anime::search($id, null, 'special_id');
		}
		else {
			return $this->redirect(array('controller' => 'search','q' => array('search' => $id)));
		}
	
	}
}