public function registerDecorator($name, $decorator)
    {
        if (is_object($name)) {
            $this->registerJavascriptObject('decorator', $this->wrapDecoratorObject($name));
        } elseif ($decorator === false) {
            $this->registerJavascriptObject('decorator', $name);
        } elseif (is_callable($decorator)) {
            $this->registerJavascriptFunction('decorator', $name, $this->wrapDecoratorCallable($name, $decorator));
        } else {
            $this->registerJavascriptFunction('decorator', $name, $decorator);
        }
    }
public function registerDecorator($name, $decorator)
    {
        if (is_object($name)) {
            $this->registerJavascriptObject('decorator', $this->wrapDecoratorObject($name));
        } elseif ($decorator === false) {
            $this->registerJavascriptObject('decorator', $name);
        } elseif (is_callable($decorator)) {
            $this->registerJavascriptFunction('decorator', $name, $this->wrapDecoratorCallable($name, $decorator));
        } else {
            $this->registerJavascriptFunction('decorator', $name, $decorator);
        }
    }
public function registerDecorator ( $ name , $ decorator ) { if ( is_object ( $ name ) ) { $ this -> registerJavascriptObject ( 'decorator' , $ this -> wrapDecoratorObject ( $ name ) ) ; } elseif ( $ decorator === false ) { $ this -> registerJavascriptObject ( 'decorator' , $ name ) ; } elseif ( is_callable ( $ decorator ) ) { $ this -> registerJavascriptFunction ( 'decorator' , $ name , $ this -> wrapDecoratorCallable ( $ name , $ decorator ) ) ; } else { $ this -> registerJavascriptFunction ( 'decorator' , $ name , $ decorator ) ; } }
Registers a decorator accessible by any template in the environment
@param string|object $name
@param string|callable|bool $decorator
Registers a decorator accessible by any template in the environment