2005-07-02 22:49:04 +00:00
|
|
|
|
<?php
|
2005-08-21 06:49:02 +00:00
|
|
|
|
/* SVN FILE: $Id$ */
|
2005-06-21 23:44:49 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2006-02-07 02:19:53 +00:00
|
|
|
|
* Methods for displaying presentation data in the view.
|
2005-12-27 03:33:44 +00:00
|
|
|
|
*
|
2005-08-21 06:49:02 +00:00
|
|
|
|
*
|
|
|
|
|
* PHP versions 4 and 5
|
|
|
|
|
*
|
|
|
|
|
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
2006-05-26 05:29:17 +00:00
|
|
|
|
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
|
|
|
|
* 1785 E. Sahara Avenue, Suite 490-204
|
|
|
|
|
* Las Vegas, Nevada 89104
|
2005-12-27 03:33:44 +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-08-21 06:49:02 +00:00
|
|
|
|
*
|
2005-12-27 03:33:44 +00:00
|
|
|
|
* @filesource
|
2006-05-26 05:29:17 +00:00
|
|
|
|
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
|
|
|
|
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
|
|
|
|
* @package cake
|
|
|
|
|
* @subpackage cake.cake.libs.view
|
|
|
|
|
* @since CakePHP v 0.10.0.1076
|
|
|
|
|
* @version $Revision$
|
|
|
|
|
* @modifiedby $LastChangedBy$
|
|
|
|
|
* @lastmodified $Date$
|
|
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
2005-08-21 06:49:02 +00:00
|
|
|
|
*/
|
2005-06-21 23:44:49 +00:00
|
|
|
|
|
2005-08-21 06:49:02 +00:00
|
|
|
|
/**
|
2006-02-18 23:42:21 +00:00
|
|
|
|
* Included libraries.
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
uses (DS . 'view' . DS . 'helper');
|
2005-07-02 22:49:04 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2005-12-22 01:07:28 +00:00
|
|
|
|
* View, the V in the MVC triad.
|
2005-08-21 06:49:02 +00:00
|
|
|
|
*
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* Class holding methods for displaying presentation data.
|
2005-07-02 22:49:04 +00:00
|
|
|
|
*
|
2006-05-26 05:29:17 +00:00
|
|
|
|
* @package cake
|
|
|
|
|
* @subpackage cake.cake.libs.view
|
2005-07-02 22:49:04 +00:00
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
class View extends Object{
|
2005-07-10 05:08:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* Name of the controller.
|
|
|
|
|
*
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* @var string Name of controller
|
2005-07-10 05:08:19 +00:00
|
|
|
|
* @access public
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $name = null;
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Stores the current URL (for links etc.)
|
|
|
|
|
*
|
|
|
|
|
* @var string Current URL
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $here = null;
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2006-01-20 07:46:14 +00:00
|
|
|
|
* Not used. 2006-09
|
2005-07-10 05:08:19 +00:00
|
|
|
|
*
|
|
|
|
|
* @var unknown_type
|
|
|
|
|
* @access public
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $parent = null;
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Action to be performed.
|
|
|
|
|
*
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* @var string Name of action
|
2005-07-10 05:08:19 +00:00
|
|
|
|
* @access public
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $action = null;
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* An array of names of models the particular controller wants to use.
|
|
|
|
|
*
|
|
|
|
|
* @var mixed A single name as a string or a list of names as an array.
|
|
|
|
|
* @access protected
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $uses = false;
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* An array of names of built-in helpers to include.
|
|
|
|
|
*
|
|
|
|
|
* @var mixed A single name as a string or a list of names as an array.
|
|
|
|
|
* @access protected
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $helpers = array('Html');
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
2005-07-21 04:02:32 +00:00
|
|
|
|
/**
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* Path to View.
|
2005-07-21 04:02:32 +00:00
|
|
|
|
*
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* @var string Path to View
|
2005-07-21 04:02:32 +00:00
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $viewPath;
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Variables for the view
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
* @access private
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $_viewVars = array();
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* Title HTML element of this View.
|
2005-07-10 05:08:19 +00:00
|
|
|
|
*
|
|
|
|
|
* @var boolean
|
|
|
|
|
* @access private
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $pageTitle = false;
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* An array of model objects.
|
|
|
|
|
*
|
|
|
|
|
* @var array Array of model objects.
|
|
|
|
|
* @access public
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $models = array();
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* Path parts for creating links in views.
|
2005-07-10 05:08:19 +00:00
|
|
|
|
*
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* @var string Base URL
|
2005-07-10 05:08:19 +00:00
|
|
|
|
* @access public
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $base = null;
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* Name of layout to use with this View.
|
2005-07-10 05:08:19 +00:00
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
* @access public
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $layout = 'default';
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* Turns on or off Cake's conventional mode of rendering views. On by default.
|
2005-07-10 05:08:19 +00:00
|
|
|
|
*
|
|
|
|
|
* @var boolean
|
|
|
|
|
* @access public
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $autoRender = true;
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* Turns on or off Cake's conventional mode of finding layout files. On by default.
|
2005-07-10 05:08:19 +00:00
|
|
|
|
*
|
|
|
|
|
* @var boolean
|
|
|
|
|
* @access public
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $autoLayout = true;
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
2005-07-21 04:02:32 +00:00
|
|
|
|
/**
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* Array of parameter data
|
2005-07-21 04:02:32 +00:00
|
|
|
|
*
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* @var array Parameter data
|
2005-07-21 04:02:32 +00:00
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $params;
|
2005-07-21 04:02:32 +00:00
|
|
|
|
/**
|
2005-10-18 22:27:39 +00:00
|
|
|
|
* True when the view has been rendered.
|
2005-07-21 04:02:32 +00:00
|
|
|
|
*
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* @var boolean
|
2005-07-21 04:02:32 +00:00
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $hasRendered = null;
|
2005-12-22 01:07:28 +00:00
|
|
|
|
|
2005-09-17 07:56:32 +00:00
|
|
|
|
/**
|
2006-02-07 02:19:53 +00:00
|
|
|
|
* Reference to the Controller for this view.
|
2005-09-17 07:56:32 +00:00
|
|
|
|
*
|
2006-02-07 02:19:53 +00:00
|
|
|
|
* @var Controller
|
2005-09-17 07:56:32 +00:00
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $controller = null;
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
2005-12-28 17:23:12 +00:00
|
|
|
|
/**
|
2006-02-07 02:19:53 +00:00
|
|
|
|
* Array of loaded view helpers.
|
2005-12-28 17:23:12 +00:00
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $loaded = array();
|
2005-12-28 17:23:12 +00:00
|
|
|
|
|
2006-01-01 02:05:01 +00:00
|
|
|
|
/**
|
2006-02-07 02:19:53 +00:00
|
|
|
|
* File extension. Defaults to Cake's conventional ".thtml".
|
2006-01-01 02:05:01 +00:00
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $ext = '.thtml';
|
2006-01-01 02:05:01 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2006-02-07 02:19:53 +00:00
|
|
|
|
* Sub-directory for this view file.
|
2006-01-01 02:05:01 +00:00
|
|
|
|
*
|
2006-02-07 02:19:53 +00:00
|
|
|
|
* @var string
|
2006-01-01 02:05:01 +00:00
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $subDir = null;
|
2006-01-01 02:05:01 +00:00
|
|
|
|
|
2006-02-01 13:26:23 +00:00
|
|
|
|
/**
|
2006-02-07 02:19:53 +00:00
|
|
|
|
* Enter description here... Themes. New in Cake RC4.
|
2006-02-01 13:26:23 +00:00
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $themeWeb = null;
|
2006-02-01 13:26:23 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2006-02-07 02:19:53 +00:00
|
|
|
|
* Plugin name. A Plugin is a sub-application. New in Cake RC4.
|
2006-02-01 13:26:23 +00:00
|
|
|
|
*
|
2006-02-07 02:19:53 +00:00
|
|
|
|
* @link http://wiki.cakephp.org/docs:plugins
|
|
|
|
|
* @var string
|
2006-02-01 13:26:23 +00:00
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
var $plugin = null;
|
2006-02-01 13:26:23 +00:00
|
|
|
|
|
2005-07-21 04:02:32 +00:00
|
|
|
|
/**
|
2005-08-25 16:40:50 +00:00
|
|
|
|
* Constructor
|
2005-07-21 04:02:32 +00:00
|
|
|
|
*
|
|
|
|
|
* @return View
|
|
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
|
function __construct(&$controller) {
|
2006-07-06 13:04:21 +00:00
|
|
|
|
$this->controller =& $controller;
|
|
|
|
|
$this->_viewVars = $this->controller->_viewVars;
|
|
|
|
|
$this->action = $this->controller->action;
|
|
|
|
|
$this->autoLayout = $this->controller->autoLayout;
|
|
|
|
|
$this->autoRender = $this->controller->autoRender;
|
|
|
|
|
$this->base = $this->controller->base;
|
|
|
|
|
$this->webroot = $this->controller->webroot;
|
|
|
|
|
$this->helpers = $this->controller->helpers;
|
|
|
|
|
$this->here = $this->controller->here;
|
|
|
|
|
$this->layout = $this->controller->layout;
|
|
|
|
|
$this->modelNames = $this->controller->modelNames;
|
|
|
|
|
$this->name = $this->controller->name;
|
|
|
|
|
$this->pageTitle = $this->controller->pageTitle;
|
|
|
|
|
$this->viewPath = $this->controller->viewPath;
|
|
|
|
|
$this->params = $this->controller->params;
|
|
|
|
|
$this->data = $this->controller->data;
|
|
|
|
|
$this->webservices = $this->controller->webservices;
|
|
|
|
|
$this->plugin = $this->controller->plugin;
|
2006-05-26 05:29:17 +00:00
|
|
|
|
parent::__construct();
|
2006-07-06 13:04:21 +00:00
|
|
|
|
} |