From 2b194248b9bbd75887c1d5f991dca1f3fd441dd5 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 15 Feb 2006 01:38:39 +0000 Subject: Added SourceTemplateControl property for TControl. --- framework/Web/UI/TTemplateControl.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'framework/Web/UI/TTemplateControl.php') diff --git a/framework/Web/UI/TTemplateControl.php b/framework/Web/UI/TTemplateControl.php index d7f1868b..d6ccb825 100644 --- a/framework/Web/UI/TTemplateControl.php +++ b/framework/Web/UI/TTemplateControl.php @@ -82,6 +82,30 @@ class TTemplateControl extends TControl implements INamingContainer $this->_localTemplate=$value; } + /** + * @return boolean whether this control is a source template control. + * A source template control loads its template from external storage, + * such as file, db, rather than from within another template. + */ + public function getIsSourceTemplateControl() + { + if(($template=$this->getTemplate())!==null) + return $template->getIsSourceTemplate(); + else + return false; + } + + /** + * @return string the directory containing the template. Empty if no template available. + */ + public function getTemplateDirectory() + { + if(($template=$this->getTemplate())!==null) + return $template->getContextPath(); + else + return ''; + } + /** * Loads the template associated with this control class. * @return ITemplate the parsed template structure -- cgit v1.2.3