Skip to content

Commit

Permalink
Removing View::$autoRender it wasn't used.
Browse files Browse the repository at this point in the history
Removing @access tags, which just restated the visibility keywords.
Adding documentation to a number of parameters and methods.
  • Loading branch information
markstory committed Dec 22, 2010
1 parent f85567a commit 4312a26
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 54 deletions.
26 changes: 21 additions & 5 deletions cake/libs/cache.php
Expand Up @@ -13,17 +13,33 @@
*
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs
* @package cake.libs
* @since CakePHP(tm) v 1.2.0.4933
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/

/**
* Caching for CakePHP.
* Cache provides a consistent interface to Caching in your application. It allows you
* to use several different Cache engines, without coupling your application to a specific
* implementation. It also allows you to change out cache storage or configuration without effecting
* the rest of your application.
*
* @package cake
* @subpackage cake.cake.libs
* You can configure Cache engines in your application's `bootstrap.php` file. A sample configuration would
* be
*
* {{{
* Cache::config('shared', array(
* 'engine' => 'Apc',
* 'prefix' => 'my_app_'
* ));
* }}}
*
* This would configure an APC cache engine to the 'shared' alias. You could then read and write
* to that cache alias by using it for the `$config` parameter in the various Cache methods. In
* general all Cache operations are supported by all cache engines. However, Cache::increment() and
* Cache::decrement() are not supported by File caching.
*
* @package cake.libs
*/
class Cache {

Expand Down
82 changes: 33 additions & 49 deletions cake/libs/view/view.php
Expand Up @@ -25,12 +25,16 @@
App::import('View', 'Helper', false);

/**
* View, the V in the MVC triad.
* View, the V in the MVC triad. View interacts with Helpers and view variables passed
* in from the controller to render the results of the controller action. Often this is HTML,
* but can also take the form of JSON, XML, PDF's or streaming files.
*
* Class holding methods for displaying presentation data.
* CakePHP uses a two-step-view pattern. This means that the view content is rendered first,
* and then inserted into the selected layout. A special `$content_for_layout` variable is available
* in the layout, and it contains the rendered view. This also means you can pass data from the view to the
* layout using `$this->set()`
*
* @package cake
* @subpackage cake.cake.libs.view
* @package cake.libs.view
*/
class View extends Object {

Expand All @@ -53,7 +57,6 @@ class View extends Object {
* Name of the controller.
*
* @var string Name of controller
* @access public
*/
public $name = null;

Expand All @@ -68,7 +71,6 @@ class View extends Object {
* 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 public
*/
public $helpers = array('Html');

Expand All @@ -83,15 +85,13 @@ class View extends Object {
* Variables for the view
*
* @var array
* @access public
*/
public $viewVars = array();

/**
* Name of layout to use with this View.
*
* @var string
* @access public
*/
public $layout = 'default';

Expand All @@ -103,42 +103,32 @@ class View extends Object {
public $layoutPath = null;

/**
* Turns on or off Cake's conventional mode of rendering views. On by default.
*
* @var boolean
* @access public
*/
public $autoRender = true;

/**
* Turns on or off Cake's conventional mode of finding layout files. On by default.
* Turns on or off Cake's conventional mode of applying layout files. On by default.
* Setting to off means that layouts will not be automatically applied to rendered views.
*
* @var boolean
* @access public
*/
public $autoLayout = true;

/**
* File extension. Defaults to Cake's template ".ctp".
*
* @var string
* @access public
*/
public $ext = '.ctp';

/**
* Sub-directory for this view file.
* Sub-directory for this view file. This is often used for extension based routing.
* for example with an `xml` extension, $subDir would be `xml/`
*
* @var string
* @access public
*/
public $subDir = null;

/**
* Theme name.
* Theme name. If you are using themes, you should remember to use ThemeView as well.
*
* @var string
* @access public
*/
public $theme = null;

Expand All @@ -147,87 +137,76 @@ class View extends Object {
*
* @see Controller::$cacheAction
* @var mixed
* @access public
*/
public $cacheAction = false;

/**
* holds current errors for the model validation
*
* @var array
* @access public
*/
public $validationErrors = array();

/**
* True when the view has been rendered.
*
* @var boolean
* @access public
*/
public $hasRendered = false;

/**
* True if in scope of model-specific region
*
* @var boolean
* @access public
*/
public $modelScope = false;

/**
* Name of current model this view context is attached to
*
* @var string
* @access public
*/
public $model = null;

/**
* Name of association model this view context is attached to
*
* @var string
* @access public
*/
public $association = null;

/**
* Name of current model field this view context is attached to
*
* @var string
* @access public
*/
public $field = null;

/**
* Suffix of current field this view context is attached to
*
* @var string
* @access public
*/
public $fieldSuffix = null;

/**
* The current model ID this view context is attached to
*
* @var mixed
* @access public
*/
public $modelId = null;

/**
* List of generated DOM UUIDs
*
* @var array
* @access public
*/
public $uuids = array();

/**
* Holds View output.
*
* @var string
* @access public
*/
public $output = false;

Expand All @@ -254,26 +233,23 @@ class View extends Object {
* List of variables to collect from the associated controller
*
* @var array
* @access protected
*/
private $__passedVars = array(
'viewVars', 'autoLayout', 'autoRender', 'ext', 'helpers', 'layout', 'name',
'viewVars', 'autoLayout', 'ext', 'helpers', 'layout', 'name',
'layoutPath', 'viewPath', 'request', 'plugin', 'passedArgs', 'cacheAction'
);

/**
* Scripts (and/or other <head /> tags) for the layout
*
* @var array
* @access protected
*/
protected $_scripts = array();

/**
* Holds an array of paths.
*
* @var array
* @access private
*/
private $__paths = array();

Expand Down Expand Up @@ -304,9 +280,8 @@ function __construct($controller) {
/**
* Renders a piece of PHP with provided parameters and returns HTML, XML, or any other string.
*
* This realizes the concept of Elements, (or "partial layouts")
* and the $params array is used to send data to be used in the
* Element. Elements can be cached through use of the cache key.
* This realizes the concept of Elements, (or "partial layouts") and the $params array is used to send
* data to be used in the element. Elements can be cached improving performance by using the `cache` option.
*
* ### Special params
*
Expand Down Expand Up @@ -381,9 +356,20 @@ public function element($name, $params = array(), $callbacks = false) {
* Renders view for given action and layout. If $file is given, that is used
* for a view filename (e.g. customFunkyView.ctp).
*
* @param string $action Name of action to render for
* @param string $layout Layout to use
* @param string $file Custom filename for view
* Render triggers helper callbacks, which are fired before and after the view are rendered,
* as well as before and after the layout. The helper callbacks are called
*
* - `beforeRender`
* - `afterRender`
* - `beforeLayout`
* - `afterLayout`
*
* If View::$autoRender is false and no `$layout` is provided, the view will be returned bare.
*
* @param string $action Name of action to render for, this will be used as the filename to render, unless
* $file is give as well.
* @param string $layout Layout to use.
* @param string $file Custom filename for view. Providing this will render a specific file for the given action.
* @return string Rendered Element
* @throws CakeException if there is an error in the view.
*/
Expand Down Expand Up @@ -582,7 +568,7 @@ public function entity() {

/**
* Allows a template or element to set a variable that will be available in
* a layout or other element. Analagous to Controller::set.
* a layout or other element. Analagous to Controller::set().
*
* @param mixed $one A string or an array of data.
* @param mixed $two Value in case $one is a string (which then works as the key).
Expand Down Expand Up @@ -648,12 +634,10 @@ public function loadHelpers() {
* array of data.
*
* @param string $___viewFn Filename of the view
* @param array $___dataForView Data to include in rendered view
* @param boolean $loadHelpers Boolean to indicate that helpers should be loaded.
* @param boolean $cached Whether or not to trigger the creation of a cache file.
* @param array $___dataForView Data to include in rendered view. If empty the current View::$viewVars will be used.
* @return string Rendered output
*/
protected function _render($___viewFn, $___dataForView = array(), $loadHelpers = true, $cached = false) {
protected function _render($___viewFn, $___dataForView = array()) {
if (empty($___dataForView)) {
$___dataForView = $this->viewVars;
}
Expand Down

0 comments on commit 4312a26

Please sign in to comment.