summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TButton.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/WebControls/TButton.php')
-rw-r--r--framework/Web/UI/WebControls/TButton.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/framework/Web/UI/WebControls/TButton.php b/framework/Web/UI/WebControls/TButton.php
index 0b118495..34f27ff2 100644
--- a/framework/Web/UI/WebControls/TButton.php
+++ b/framework/Web/UI/WebControls/TButton.php
@@ -47,7 +47,7 @@
* @package System.Web.UI.WebControls
* @since 3.0
*/
-class TButton extends TWebControl implements IPostBackEventHandler, IButtonControl
+class TButton extends TWebControl implements IPostBackEventHandler, IButtonControl, IDataRenderer
{
/**
* @return string tag name of the button
@@ -222,6 +222,32 @@ class TButton extends TWebControl implements IPostBackEventHandler, IButtonContr
}
/**
+ * Returns the caption of the button.
+ * This method is required by {@link IDataRenderer}.
+ * It is the same as {@link getText()}.
+ * @return string caption of the button.
+ * @see getText
+ * @since 3.1.0
+ */
+ public function getData()
+ {
+ return $this->getText();
+ }
+
+ /**
+ * Sets the caption of the button.
+ * This method is required by {@link IDataRenderer}.
+ * It is the same as {@link setText()}.
+ * @param string caption of the button
+ * @see setText
+ * @since 3.1.0
+ */
+ public function setData($value)
+ {
+ $this->setText($value);
+ }
+
+ /**
* @return boolean whether postback event trigger by this button will cause input validation, default is true
*/
public function getCausesValidation()