Core/Template/Template.php
public static function extend($method) {
        if (is_array($method)) {
            if (count($method) == 2 && method_exists($method[0], $method[1])) {
                array_push(self::$_extends, ['class' => $method[0], 'method' => $method[1]]);
            }
            else {
                throw new MissingTemplateException('You c\'ant extend the template engine with the method : "' . $method[0] . '"');
            }
        }
        else {
            $trace = debug_backtrace();

            if (isset($trace[1])) {
                array_push(self::$_extends, ['class' => '\\' . $trace[1]['class'], 'method' => $method]);
            }
            else {
                throw new MissingTemplateException('Can\'t reach the method "' . $method . '"');
            }
        }
    }
public static function extend($method) {
        if (is_array($method)) {
            if (count($method) == 2 && method_exists($method[0], $method[1])) {
                array_push(self::$_extends, ['class' => $method[0], 'method' => $method[1]]);
            }
            else {
                throw new MissingTemplateException('You c\'ant extend the template engine with the method : "' . $method[0] . '"');
            }
        }
        else {
            $trace = debug_backtrace();

            if (isset($trace[1])) {
                array_push(self::$_extends, ['class' => '\\' . $trace[1]['class'], 'method' => $method]);
            }
            else {
                throw new MissingTemplateException('Can\'t reach the method "' . $method . '"');
            }
        }
    }
public static function extend ( $ method ) { if ( is_array ( $ method ) ) { if ( count ( $ method ) == 2 && method_exists ( $ method [ 0 ] , $ method [ 1 ] ) ) { array_push ( self :: $ _extends , [ 'class' => $ method [ 0 ] , 'method' => $ method [ 1 ] ] ) ; } else { throw new MissingTemplateException ( 'You c\'ant extend the template engine with the method : "' . $ method [ 0 ] . '"' ) ; } } else { $ trace = debug_backtrace ( ) ; if ( isset ( $ trace [ 1 ] ) ) { array_push ( self :: $ _extends , [ 'class' => '\\' . $ trace [ 1 ] [ 'class' ] , 'method' => $ method ] ) ; } else { throw new MissingTemplateException ( 'Can\'t reach the method "' . $ method . '"' ) ; } } }
permit to extend the template engine with custom functions
@access public
@param $method mixed array,string
@throws MissingTemplateException
@return void
@since 3.0
@package Gcs\Framework\Core\Template
permit to extend the template engine with custom functions