summaryrefslogtreecommitdiff
path: root/framework/TComponent.php
diff options
context:
space:
mode:
authorxue <>2006-08-28 02:21:48 +0000
committerxue <>2006-08-28 02:21:48 +0000
commit5a55bca3e31f4cefa2b3fa6e854431db91528837 (patch)
tree5e3ac35cce2397059e9165cc1edcc7faf8988ba5 /framework/TComponent.php
parent304427074ddf629fd2708b23a3fe0cd0122c05a8 (diff)
Moved createdOnTemplate() and addParsedObject() from TControl to TComponent so that template instantiation is more consistent among non-control components and controls.
Diffstat (limited to 'framework/TComponent.php')
-rw-r--r--framework/TComponent.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/framework/TComponent.php b/framework/TComponent.php
index 7564edff..21a62abd 100644
--- a/framework/TComponent.php
+++ b/framework/TComponent.php
@@ -415,6 +415,32 @@ class TComponent
throw new TInvalidOperationException('component_statements_invalid',get_class($this),$statements,$e->getMessage());
}
}
+
+ /**
+ * This method is invoked after the component is instantiated by a template.
+ * When this method is invoked, the component's properties have been initialized.
+ * The default implementation of this method will invoke
+ * the potential parent component's {@link addParsedObject}.
+ * This method can be overriden.
+ * @param TComponent potential parent of this control
+ * @see addParsedObject
+ */
+ public function createdOnTemplate($parent)
+ {
+ $parent->addParsedObject($this);
+ }
+
+ /**
+ * Processes an object that is created during parsing template.
+ * The object can be either a component or a static text string.
+ * This method can be overriden to customize the handling of newly created objects in template.
+ * Only framework developers and control developers should use this method.
+ * @param string|TComponent text string or component parsed and instantiated in template
+ * @see createdOnTemplate
+ */
+ public function addParsedObject($object)
+ {
+ }
}
/**