Subversion-Projekte lars-tiefland.cakephp

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/* SVN FILE: $Id: pages_controller.php 7945 2008-12-19 02:16:01Z gwoo $ */
3
/**
4
 * Static content controller.
5
 *
6
 * This file will render views from views/pages/
7
 *
8
 * PHP versions 4 and 5
9
 *
10
 * CakePHP(tm) :  Rapid Development Framework (http://www.cakephp.org)
11
 * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
12
 *
13
 * Licensed under The MIT License
14
 * Redistributions of files must retain the above copyright notice.
15
 *
16
 * @filesource
17
 * @copyright     Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
18
 * @link          http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
19
 * @package       cake
20
 * @subpackage    cake.cake.libs.controller
21
 * @since         CakePHP(tm) v 0.2.9
22
 * @version       $Revision: 7945 $
23
 * @modifiedby    $LastChangedBy: gwoo $
24
 * @lastmodified  $Date: 2008-12-18 18:16:01 -0800 (Thu, 18 Dec 2008) $
25
 * @license       http://www.opensource.org/licenses/mit-license.php The MIT License
26
 */
27
/**
28
 * Static content controller
29
 *
30
 * Override this controller by placing a copy in controllers directory of an application
31
 *
32
 * @package       cake
33
 * @subpackage    cake.cake.libs.controller
34
 */
35
class PagesController extends AppController {
36
/**
37
 * Controller name
38
 *
39
 * @var string
40
 * @access public
41
 */
42
	var $name = 'Pages';
43
/**
44
 * Default helper
45
 *
46
 * @var array
47
 * @access public
48
 */
49
	var $helpers = array('Html');
50
/**
51
 * This controller does not use a model
52
 *
53
 * @var array
54
 * @access public
55
 */
56
	var $uses = array();
57
/**
58
 * Displays a view
59
 *
60
 * @param mixed What page to display
61
 * @access public
62
 */
63
	function display() {
64
		$path = func_get_args();
65
 
66
		$count = count($path);
67
		if (!$count) {
68
			$this->redirect('/');
69
		}
70
		$page = $subpage = $title = null;
71
 
72
		if (!empty($path[0])) {
73
			$page = $path[0];
74
		}
75
		if (!empty($path[1])) {
76
			$subpage = $path[1];
77
		}
78
		if (!empty($path[$count - 1])) {
79
			$title = Inflector::humanize($path[$count - 1]);
80
		}
81
		$this->set(compact('page', 'subpage', 'title'));
82
		$this->render(join('/', $path));
83
	}
84
}
85
 
86
?>