[ Index ]
 

Code source de CakePHP 1.1.13.4450

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/cake/libs/controller/ -> pages_controller.php (source)

   1  <?php
   2  /* SVN FILE: $Id: pages_controller.php 4409 2007-02-02 13:20:59Z phpnut $ */
   3  
   4  /**
   5   * Short description for file.
   6   *
   7   * This file is application-wide controller file. You can put all
   8   * application-wide controller-related methods here.
   9   *
  10   * PHP versions 4 and 5
  11   *
  12   * CakePHP(tm) :  Rapid Development Framework <http://www.cakephp.org/>
  13   * Copyright 2005-2007, Cake Software Foundation, Inc.
  14   *                                1785 E. Sahara Avenue, Suite 490-204
  15   *                                Las Vegas, Nevada 89104
  16   *
  17   * Licensed under The MIT License
  18   * Redistributions of files must retain the above copyright notice.
  19   *
  20   * @filesource
  21   * @copyright        Copyright 2005-2007, Cake Software Foundation, Inc.
  22   * @link                http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
  23   * @package            cake
  24   * @subpackage        cake.cake.libs.controller
  25   * @since            CakePHP(tm) v 0.2.9
  26   * @version            $Revision: 4409 $
  27   * @modifiedby        $LastChangedBy: phpnut $
  28   * @lastmodified    $Date: 2007-02-02 07:20:59 -0600 (Fri, 02 Feb 2007) $
  29   * @license            http://www.opensource.org/licenses/mit-license.php The MIT License
  30   */
  31  
  32  /**
  33   * Short description for class.
  34   *
  35   * This file is application-wide controller file. You can put all
  36   * application-wide controller-related methods here.
  37   *
  38   * Add your application-wide methods in the class below, your controllers
  39   * will inherit them.
  40   *
  41   * @package        cake
  42   * @subpackage    cake.cake.libs.controller
  43   */
  44  class PagesController extends AppController{
  45  
  46  /**
  47   * Enter description here...
  48   *
  49   * @var unknown_type
  50   */
  51       var $name = 'Pages';
  52  
  53  /**
  54   * Enter description here...
  55   *
  56   * @var unknown_type
  57   */
  58       var $helpers = array('Html');
  59  
  60  /**
  61   * This controller does not use a model
  62   *
  63   * @var $uses
  64   */
  65       var $uses = null;
  66  
  67  /**
  68   * Displays a view
  69   *
  70   */
  71  	 function display() {
  72            if (!func_num_args()) {
  73                  $this->redirect('/');
  74            }
  75  
  76            $path=func_get_args();
  77  
  78            if (!count($path)) {
  79                  $this->redirect('/');
  80            }
  81  
  82            $count  =count($path);
  83            $page   =null;
  84            $subpage=null;
  85            $title  =null;
  86  
  87            if (!empty($path[0])) {
  88                  $page = $path[0];
  89            }
  90  
  91            if (!empty($path[1])) {
  92                  $subpage = $path[1];
  93            }
  94  
  95            if (!empty($path[$count - 1])) {
  96                  $title = ucfirst($path[$count - 1]);
  97            }
  98  
  99            $this->set('page', $page);
 100            $this->set('subpage', $subpage);
 101            $this->set('title', $title);
 102            $this->render(join('/', $path));
 103       }
 104  }
 105  ?>


Généré le : Sun Feb 25 19:27:47 2007 par Balluche grâce à PHPXref 0.7