corregido el manejo de parámetros en la unfión de utilidad url()
[qcms.git] / controllers / pages_controller.php
blob5d3121c1e354071e0441920ad4d65fea697220ad
1 <?php
2 /* SVN FILE: $Id: pages_controller.php 6296 2008-01-01 22:18:17Z phpnut $ */
3 /**
4 * Static content controller.
6 * This file will render views from views/pages/
8 * PHP versions 4 and 5
10 * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
11 * Copyright 2005-2008, Cake Software Foundation, Inc.
12 * 1785 E. Sahara Avenue, Suite 490-204
13 * Las Vegas, Nevada 89104
15 * Licensed under The MIT License
16 * Redistributions of files must retain the above copyright notice.
18 * @filesource
19 * @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
20 * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
21 * @package cake
22 * @subpackage cake.cake.libs.controller
23 * @since CakePHP(tm) v 0.2.9
24 * @version $Revision: 6296 $
25 * @modifiedby $LastChangedBy: phpnut $
26 * @lastmodified $Date: 2008-01-01 20:18:17 -0200 (mar, 01 ene 2008) $
27 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
29 /**
30 * Static content controller
32 * Override this controller by placing a copy in controllers directory of an application
34 * @package cake
35 * @subpackage cake.cake.libs.controller
37 class PagesController extends AppController{
38 /**
39 * Controller name
41 * @var string
42 * @access public
44 var $name = 'Pages';
45 /**
46 * Default helper
48 * @var array
49 * @access public
51 var $helpers = array('Html');
52 /**
53 * This controller does not use a model
55 * @var array
56 * @access public
58 var $uses = array();
59 /**
60 * Displays a view
62 * @param mixed What page to display
63 * @access public
65 function display() {
66 if (!func_num_args()) {
67 $this->redirect('/');
69 $path = func_get_args();
71 if (!count($path)) {
72 $this->redirect('/');
74 $count = count($path);
75 $page = null;
76 $subpage = null;
77 $title = null;
79 if (!empty($path[0])) {
80 $page = $path[0];
82 if (!empty($path[1])) {
83 $subpage = $path[1];
85 if (!empty($path[$count - 1])) {
86 $title = Inflector::humanize($path[$count - 1]);
88 $this->set('page', $page);
89 $this->set('subpage', $subpage);
90 $this->set('title', $title);
91 $this->render(join('/', $path));