summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--framework/TComponent.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/framework/TComponent.php b/framework/TComponent.php
index a23204d5..8df1f235 100644
--- a/framework/TComponent.php
+++ b/framework/TComponent.php
@@ -342,12 +342,17 @@ class TComponent
{
// an array: 0 - object, 1 - method name/path
list($object,$method)=$handler;
- if(($pos=strrpos($method,'.'))!==false)
+ if(is_string($object)) // static method call
+ call_user_func($handler,$sender,$param);
+ else
{
- $object=$this->getSubProperty(substr($method,0,$pos));
- $method=substr($method,$pos+1);
+ if(($pos=strrpos($method,'.'))!==false)
+ {
+ $object=$this->getSubProperty(substr($method,0,$pos));
+ $method=substr($method,$pos+1);
+ }
+ $object->$method($sender,$param);
}
- $object->$method($sender,$param);
}
else
throw new TInvalidDataValueException('component_event_handler_invalid',$handler);