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-2010, 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-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
16 * @link http://cakephp.org CakePHP(tm) Project
18 * @subpackage cake.cake.libs.controller
19 * @since CakePHP(tm) v 0.2.9
20 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
24 * Static content controller
26 * Override this controller by placing a copy in controllers directory of an application
29 * @subpackage cake.cake.libs.controller
30 * @link http://book.cakephp.org/view/958/The-Pages-Controller
32 class PagesController
extends AppController
{
48 var $helpers = array('Html', 'Session');
51 * This controller does not use a model
61 * @param mixed What page to display
65 $path = func_get_args();
68 $count = count($path);
72 $page = $subpage = $title_for_layout = null;
74 if (!empty($path[0])) {
77 if (!empty($path[1])) {
80 if (!empty($path[$count - 1])) {
81 $title_for_layout = Inflector
::humanize($path[$count - 1]);
83 $this->set(compact('page', 'subpage', 'title_for_layout'));
84 $this->render(implode('/', $path));
87 function admin_display() {
88 $path = func_get_args();
90 /* if (isset($this->params['admin']))
92 if (!isset($path[0]) ||
$path[0] != 'admin') {
93 //This adds admin to the beginning of the path so the pages controller will look in the 'admin' folder in pages directory
94 $path = array_merge((array)'admin', $path);
96 $count = count($path);
100 $page = $subpage = $title_for_layout = null;
102 if (!empty($path[0])) {
105 if (!empty($path[1])) {
108 if (!empty($path[$count - 1])) {
109 $title_for_layout = Inflector
::humanize($path[$count - 1]);
111 $this->set(compact('page', 'subpage', 'title_for_layout'));
112 $this->render(implode('/', $path));
115 function beforeFilter() {
116 parent
::beforeFilter();
117 $this->Auth
->allow(array('display'));