From 55c4ac1bfe565f1ca7f537fdd8b7a201be28e581 Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 10 Nov 2005 12:47:19 +0000 Subject: Initial import of prado framework --- framework/Web/UI/WebControls/TStatements.php | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 framework/Web/UI/WebControls/TStatements.php (limited to 'framework/Web/UI/WebControls/TStatements.php') 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 @@ + + * @link http://www.xisc.com/ + * @copyright Copyright © 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 Statements. + * You should also specify the context object by Context property + * which is used as the object in which the statements is evaluated. + * If the Context property is not set, the TStatements component + * itself will be assumed as the context. + * + * @author Qiang Xue + * @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)); + } +} + +?> -- cgit v1.2.3