summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TControl.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/TControl.php')
-rw-r--r--framework/Web/UI/TControl.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php
index 583b5f77..ff4a85ea 100644
--- a/framework/Web/UI/TControl.php
+++ b/framework/Web/UI/TControl.php
@@ -452,6 +452,28 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable
}
/**
+ * Returns custom data associated with this control.
+ * A control may be associated with some custom data for various purposes.
+ * For example, a button may be associated with a string to identify itself
+ * in a generic OnClick event handler.
+ * @return mixed custom data associated with this control. Defaults to null.
+ */
+ public function getCustomData()
+ {
+ return $this->getViewState('CustomData',null);
+ }
+
+ /**
+ * Associates custom data with this control.
+ * Note, the custom data must be serializable and unserializable.
+ * @param mixed custom data
+ */
+ public function setCustomData($value)
+ {
+ $this->getViewState('CustomData',$value,null);
+ }
+
+ /**
* @return boolean whether the control has child controls
*/
public function getHasControls()