* Refactor the magic method to support call static method. Only static
methods of classes declared in a zen file or an ext zen file or a tao file or an ext tao file can be called.
This commit is contained in:
@@ -367,9 +367,11 @@ class model extends baseModel
|
||||
public static function __callStatic($method, $arguments)
|
||||
{
|
||||
global $app;
|
||||
$moduleName = $app->getModuleName();
|
||||
$taoClass = $moduleName . 'Tao';
|
||||
$moduleName = get_called_class();
|
||||
$taoClass = 'ext' . $moduleName . 'Tao';
|
||||
if(is_callable("{$taoClass}::{$method}")) return call_user_func_array("{$taoClass}::{$method}", $arguments);
|
||||
|
||||
$taoClass = $moduleName . 'Tao';
|
||||
if(is_callable("{$taoClass}::{$method}")) return call_user_func_array("{$taoClass}::{$method}", $arguments);
|
||||
|
||||
$app->triggerError("the module {$moduleName} has no {$method} method", __FILE__, __LINE__, $exit = true);
|
||||
|
||||
Reference in New Issue
Block a user