2005-06-21 23:44:49 +00:00
|
|
|
<?php
|
2005-08-21 06:49:02 +00:00
|
|
|
/* SVN FILE: $Id$ */
|
2005-07-04 01:24:13 +00:00
|
|
|
/**
|
2007-09-16 01:06:17 +00:00
|
|
|
* Static content controller.
|
2005-12-27 03:33:44 +00:00
|
|
|
*
|
2007-09-16 01:06:17 +00:00
|
|
|
* This file will render views from views/pages/
|
2005-08-21 06:49:02 +00:00
|
|
|
*
|
|
|
|
* PHP versions 4 and 5
|
|
|
|
*
|
2007-02-02 10:39:45 +00:00
|
|
|
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
|
|
|
|
* Copyright 2005-2007, Cake Software Foundation, Inc.
|
2006-05-26 05:29:17 +00:00
|
|
|
* 1785 E. Sahara Avenue, Suite 490-204
|
|
|
|
* Las Vegas, Nevada 89104
|
2005-08-21 06:49:02 +00:00
|
|
|
*
|
2005-12-23 21:57:26 +00:00
|
|
|
* Licensed under The MIT License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
2005-07-04 01:24:13 +00:00
|
|
|
*
|
2005-12-27 03:33:44 +00:00
|
|
|
* @filesource
|
2007-02-02 10:39:45 +00:00
|
|
|
* @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
|
|
|
|
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
2006-05-26 05:29:17 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.libs.controller
|
2007-02-02 10:39:45 +00:00
|
|
|
* @since CakePHP(tm) v 0.2.9
|
2006-05-26 05:29:17 +00:00
|
|
|
* @version $Revision$
|
|
|
|
* @modifiedby $LastChangedBy$
|
|
|
|
* @lastmodified $Date$
|
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
2005-07-04 01:24:13 +00:00
|
|
|
*/
|
|
|
|
/**
|
2007-09-16 01:06:17 +00:00
|
|
|
* Static content controller
|
2005-07-04 01:24:13 +00:00
|
|
|
*
|
2007-09-16 01:06:17 +00:00
|
|
|
* Override this controller by placing a copy in controllers directory of an application
|
2005-12-27 03:33:44 +00:00
|
|
|
*
|
2006-05-26 05:29:17 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.libs.controller
|
2005-07-04 01:24:13 +00:00
|
|
|
*/
|
2005-10-03 04:48:00 +00:00
|
|
|
class PagesController extends AppController{
|
2006-03-26 09:59:40 +00:00
|
|
|
/**
|
2007-09-16 01:06:17 +00:00
|
|
|
* Controller name
|
2006-03-26 09:59:40 +00:00
|
|
|
*
|
2007-09-16 01:06:17 +00:00
|
|
|
* @var string
|
2006-03-26 09:59:40 +00:00
|
|
|
*/
|
2007-09-16 01:06:17 +00:00
|
|
|
var $name = 'Pages';
|
2005-07-04 01:24:13 +00:00
|
|
|
/**
|
2007-09-16 01:06:17 +00:00
|
|
|
* Default helper
|
2005-07-04 01:24:13 +00:00
|
|
|
*
|
2007-09-16 01:06:17 +00:00
|
|
|
* @var array
|
2005-08-21 06:49:02 +00:00
|
|
|
*/
|
2007-09-16 01:06:17 +00:00
|
|
|
var $helpers = array('Html');
|
2006-02-03 15:05:46 +00:00
|
|
|
/**
|
|
|
|
* This controller does not use a model
|
|
|
|
*
|
2007-09-16 01:06:17 +00:00
|
|
|
* @var array
|
2006-02-03 15:05:46 +00:00
|
|
|
*/
|
2007-09-16 01:06:17 +00:00
|
|
|
var $uses = array();
|
2005-07-04 01:24:13 +00:00
|
|
|
/**
|
|
|
|
* Displays a view
|
|
|
|
*
|
|
|
|
*/
|
2007-09-16 01:06:17 +00:00
|
|
|
function display() {
|
|
|
|
if (!func_num_args()) {
|
|
|
|
$this->redirect('/');
|
|
|
|
}
|
|
|
|
$path = func_get_args();
|
2006-04-27 10:04:08 +00:00
|
|
|
|
2007-09-16 01:06:17 +00:00
|
|
|
if (!count($path)) {
|
|
|
|
$this->redirect('/');
|
|
|
|
}
|
|
|
|
$count = count($path);
|
|
|
|
$page = null;
|
|
|
|
$subpage = null;
|
|
|
|
$title = null;
|
2006-04-27 10:04:08 +00:00
|
|
|
|
2007-09-16 01:06:17 +00:00
|
|
|
if (!empty($path[0])) {
|
|
|
|
$page = $path[0];
|
|
|
|
}
|
|
|
|
if (!empty($path[1])) {
|
|
|
|
$subpage = $path[1];
|
|
|
|
}
|
|
|
|
if (!empty($path[$count - 1])) {
|
|
|
|
$title = Inflector::humanize($path[$count - 1]);
|
|
|
|
}
|
|
|
|
$this->set('page', $page);
|
|
|
|
$this->set('subpage', $subpage);
|
|
|
|
$this->set('title', $title);
|
|
|
|
$this->render(join('/', $path));
|
|
|
|
}
|
2005-05-22 23:24:09 +00:00
|
|
|
}
|
|
|
|
?>
|