App_CLI::addGlobalMethod PHP Метод

addGlobalMethod() публичный Метод

obj.test = function() { .. } All non-existant method calls on all Agile Toolkit objects will be tried against local table of registered methods and then against global registered methods. addGlobalmethod allows you to register a globally-recognized for all agile toolkit object. PHP is not particularly fast about executing methods like that, but this technique can be used for adding backward-compatibility or debugging, etc.
См. также: AbstractObject::hasMethod()
См. также: AbstractObject::__call()
public addGlobalMethod ( string $name, callable $callable )
$name string Name of the method
$callable callable Calls your function($object, $arg1, $arg2)
    public function addGlobalMethod($name, $callable)
    {
        if ($this->hasMethod($name)) {
            throw $this->exception('Registering method twice')->addMoreInfo('name', $name);
        }
        $this->addHook('global-method-' . $name, $callable);
    }