3
* Static content controller.
5
* This file will render views from views/pages/
9
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
10
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
12
* Licensed under The MIT License
13
* Redistributions of files must retain the above copyright notice.
15
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
16
* @link http://cakephp.org CakePHP(tm) Project
17
* @package Cake.Controller
18
* @since CakePHP(tm) v 0.2.9
19
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
22
App::uses('AppController', 'Controller');
25
* Static content controller
27
* Override this controller by placing a copy in controllers directory of an application
29
* @package Cake.Controller
30
* @link http://book.cakephp.org/2.0/en/controllers/pages-controller.html
32
class PagesController extends AppController {
39
public $helpers = array('Html', 'Session');
42
* This controller does not use a model
46
public $uses = array();
51
* @param mixed What page to display
54
public function display() {
55
$path = func_get_args();
57
$count = count($path);
61
$page = $subpage = $titleForLayout = null;
63
if (!empty($path[0])) {
66
if (!empty($path[1])) {
69
if (!empty($path[$count - 1])) {
70
$titleForLayout = Inflector::humanize($path[$count - 1]);
74
'subpage' => $subpage,
75
'title_for_layout' => $titleForLayout
77
$this->render(implode('/', $path));