diff options
author | xue <> | 2006-02-15 01:38:39 +0000 |
---|---|---|
committer | xue <> | 2006-02-15 01:38:39 +0000 |
commit | 2b194248b9bbd75887c1d5f991dca1f3fd441dd5 (patch) | |
tree | 833dc5c56d702d5188b383d3124759965d9b972f /framework/Web/UI/TTemplateControl.php | |
parent | cd1ffb47a6c07deda47052eff80452e78a52495d (diff) |
Added SourceTemplateControl property for TControl.
Diffstat (limited to 'framework/Web/UI/TTemplateControl.php')
-rw-r--r-- | framework/Web/UI/TTemplateControl.php | 24 |
1 files changed, 24 insertions, 0 deletions
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 @@ -83,6 +83,30 @@ class TTemplateControl extends TControl implements INamingContainer }
/**
+ * @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
*/
|