summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorxue <>2007-04-02 01:26:38 +0000
committerxue <>2007-04-02 01:26:38 +0000
commitc29fa08c41c2774f2e4c4b3aa0dfa7a0ade86e7c (patch)
tree1c659b4b629cd60c5a58a85483ef7dfb3427caf5 /framework
parent9d8f7d6cd2b0fd691c640473e524a2902c211e69 (diff)
fixed the issue that Event handler specified via subproperty in template does not work
Diffstat (limited to 'framework')
-rw-r--r--framework/TComponent.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/framework/TComponent.php b/framework/TComponent.php
index 54fe7ec7..79732290 100644
--- a/framework/TComponent.php
+++ b/framework/TComponent.php
@@ -345,7 +345,17 @@ class TComponent
{
if(is_string($handler))
{
- call_user_func($handler,$sender,$param);
+ if(($pos=strrpos($handler,'.'))!==false)
+ {
+ $object=$this->getSubProperty(substr($handler,0,$pos));
+ $method=substr($handler,$pos+1);
+ if(method_exists($object,$method))
+ $object->$method($sender,$param);
+ else
+ throw new TInvalidDataValueException('component_eventhandler_invalid',get_class($this),$name);
+ }
+ else
+ call_user_func($handler,$sender,$param);
}
else if(is_callable($handler,true))
{