summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TStatements.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/WebControls/TStatements.php')
-rw-r--r--framework/Web/UI/WebControls/TStatements.php61
1 files changed, 61 insertions, 0 deletions
diff --git a/framework/Web/UI/WebControls/TStatements.php b/framework/Web/UI/WebControls/TStatements.php
new file mode 100644
index 00000000..e0892f2b
--- /dev/null
+++ b/framework/Web/UI/WebControls/TStatements.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * TStatements class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.xisc.com/
+ * @copyright Copyright &copy; 2004-2005, Qiang Xue
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version $Revision: $ $Date: $
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TStatements class
+ *
+ * TStatements executes a set of PHP statements and renders the display
+ * generated by the statements. The execution happens during rendering stage.
+ * You can set the statements via the property <b>Statements</b>.
+ * You should also specify the context object by <b>Context</b> property
+ * which is used as the object in which the statements is evaluated.
+ * If the <b>Context</b> property is not set, the TStatements component
+ * itself will be assumed as the context.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @version $Revision: $ $Date: $
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TStatements extends TControl
+{
+ private $_s='';
+
+ /**
+ * @return string the statements to be executed
+ */
+ public function getStatements()
+ {
+ return $this->_s;
+ }
+
+ /**
+ * Sets the statements of the TStatements
+ * @param string the statements to be set
+ */
+ public function setStatements($value)
+ {
+ $this->_s=$value;
+ }
+
+ /**
+ * Renders the evaluation result of the statements.
+ * @param THtmlTextWriter the writer used for the rendering purpose
+ */
+ protected function render($writer)
+ {
+ if($this->_s!=='')
+ $writer->write($this->evaluateStatements($this->_s));
+ }
+}
+
+?>