mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
Support calling namespaced class in trigger
This commit is contained in:
parent
eb10708a88
commit
51173863c1
1 changed files with 14 additions and 2 deletions
|
|
@ -1249,8 +1249,20 @@ class ModuleHandler extends Handler
|
|||
$type = $item->type;
|
||||
$called_method = $item->called_method;
|
||||
|
||||
// todo why don't we call a normal class object ?
|
||||
$oModule = getModule($module, $type);
|
||||
// Get instance of module class
|
||||
if (strpos($type, '\\') !== false)
|
||||
{
|
||||
$class_name = sprintf('Rhymix\\Modules\\%s\\%s', $module, $type);
|
||||
if (class_exists($class_name))
|
||||
{
|
||||
$oModule = $class_name::getInstance();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$oModule = getModule($module, $type);
|
||||
}
|
||||
|
||||
if(!$oModule || !method_exists($oModule, $called_method))
|
||||
{
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue