summaryrefslogtreecommitdiff
path: root/lib/prado/framework/Web/UI/TControl.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-06-08 15:19:11 +0200
committeremkael <emkael@tlen.pl>2016-06-10 11:46:41 +0200
commit6ab01ff111f2aca0786f4fd45df25ea6ad9be1ca (patch)
treeb8002a9239b2d4050bcc8ad48cccc39d56ffbe34 /lib/prado/framework/Web/UI/TControl.php
parent90d93b09640ef2026d4450e17f9e9c5fedb76c81 (diff)
* Prado upgraded to 3.3.1-rbd4929d
Diffstat (limited to 'lib/prado/framework/Web/UI/TControl.php')
-rw-r--r--lib/prado/framework/Web/UI/TControl.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/prado/framework/Web/UI/TControl.php b/lib/prado/framework/Web/UI/TControl.php
index be7b118..1b8a213 100644
--- a/lib/prado/framework/Web/UI/TControl.php
+++ b/lib/prado/framework/Web/UI/TControl.php
@@ -196,6 +196,31 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable
}
/**
+ * Checks for the existance of a property value by name or a control by ID.
+ * This overrides the parent implementation by allowing checking for the
+ * existance of a control via its ID using the following syntax,
+ * <code>
+ * $menuBarExists = isset($this->menuBar);
+ * </code>
+ * Do not call this method. This is a PHP magic method that we override
+ * to allow using isset() to detect if a component property is set or not.
+ * Note, the control must be configured in the template
+ * with explicit ID. If the name matches both a property and a control ID,
+ * the control ID will take the precedence.
+ *
+ * @param string the property name or control ID
+ * @return bool wether the control or property exists
+ * @see __get
+ */
+ public function __isset($name) {
+ if(isset($this->_rf[self::RF_NAMED_OBJECTS][$name])) {
+ return true;
+ } else {
+ return parent::__isset($name);
+ }
+ }
+
+ /**
* @return boolean whether there is an adapter for this control
*/
public function getHasAdapter()