Skip to content

Commit

Permalink
adding magic method__isset() for overloaded properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeram committed Dec 29, 2011
1 parent 1d333fd commit 929a403
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions lib/Cake/View/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ public function render($view = null, $layout = null) {
* the 'meta', 'css', and 'script' blocks. They are appended in that order.
*
* Deprecated features:
*
*
* - `$scripts_for_layout` is deprecated and will be removed in CakePHP 3.0.
* Use the block features instead. `meta`, `css` and `script` will be populated
* by the matching methods on HtmlHelper.
Expand Down Expand Up @@ -600,7 +600,7 @@ public function start($name) {
}

/**
* Append to an existing or new block. Appending to a new
* Append to an existing or new block. Appending to a new
* block will create the block.
*
* @param string $name Name of the block
Expand Down Expand Up @@ -650,7 +650,7 @@ public function end() {
}

/**
* Provides view or element extension/inheritance. Views can extends a
* Provides view or element extension/inheritance. Views can extends a
* parent view and populate blocks in the parent template.
*
* @param string $name The view or element to 'extend' the current one with.
Expand All @@ -668,7 +668,7 @@ public function extend($name) {
case self::TYPE_LAYOUT:
$parent = $this->_getLayoutFileName($name);
break;

}
if ($parent == $this->_current) {
throw new LogicException(__d('cake_dev', 'You cannot have views extend themselves.'));
Expand Down Expand Up @@ -775,7 +775,7 @@ public function __get($name) {

/**
* Magic accessor for deprecated attributes.
*
*
* @param string $name Name of the attribute to set.
* @param string $value Value of the attribute to set.
* @return mixed
Expand All @@ -789,6 +789,16 @@ public function __set($name, $value) {
}
}

/**
* Magic isset check for deprecated attributes.
*
* @param string $name Name of the attribute to check.
* @return boolean
*/
public function __isset($name) {
return isset($this->name);
}

/**
* Interact with the HelperCollection to load all the helpers.
*
Expand Down Expand Up @@ -845,7 +855,7 @@ protected function _render($viewFile, $data = array()) {
* Sandbox method to evaluate a template / view script in.
*
* @param string $___viewFn Filename of the view
* @param array $___dataForView Data to include in rendered view.
* @param array $___dataForView Data to include in rendered view.
* If empty the current View::$viewVars will be used.
* @return string Rendered output
*/
Expand Down

0 comments on commit 929a403

Please sign in to comment.