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
5177
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 . '"');
            }
        }
    }
505321
public function setMethod($method)
    {
        parent::setMethod($method);
        if ($method !== 'GET') {
            switch ($method) {
                case 'POST':
                    $this->setOption(CURLOPT_POST, true);
                    break;
                default:
                    $this->setOption(CURLOPT_CUSTOMREQUEST, $this->method);
                    break;
            }
        }

        return $this;
    }
929690
private function addTemplateFunctions()
    {
        //Asignamos las funciones especiales
        $functions = [
            'asset' => TemplateFunctions::ASSETS_FUNCTION,
            'form' => TemplateFunctions::FORM_FUNCTION,
            'form_widget' => TemplateFunctions::WIDGET_FUNCTION,
            'form_button' => TemplateFunctions::BUTTON_FUNCTION,
            'get_config' => TemplateFunctions::CONFIG_FUNCTION,
            'path' => TemplateFunctions::ROUTE_FUNCTION,
            'resource' => TemplateFunctions::RESOURCE_FUNCTION,
            'session' => TemplateFunctions::SESSION_FUNCTION,
            'existsFlash' => TemplateFunctions::EXISTS_FLASH_FUNCTION,
            'getFlash' => TemplateFunctions::GET_FLASH_FUNCTION,
            'getQuery' => TemplateFunctions::GET_QUERY_FUNCTION,
        ];
        foreach($functions as $name => $function) {
            $this->addTemplateFunction($name, $function);
        }
    }
578781
public function setMethod($method) {
        if (!is_string($method))                 throw new IllegalTypeException('Illegal type of parameter $method: '.gettype($method));
        if ($method!=='GET' && $method!=='POST') throw new InvalidArgumentException('Invalid argument $method: '.$method);

        $this->method = $method;
        return $this;
    }
402327
public function setMethod($method)
	{
		parent::setMethod($method);
		$method = strtolower($method);
		if($method == "aes-256-ecb")
		{
			$this->_type = MCRYPT_RIJNDAEL_128;
			$this->_mode = "ecb";
		}
		elseif($method == "aes-256-cbc")
		{
			$this->_type = MCRYPT_RIJNDAEL_128;
			$this->_mode = "cbc";
		}
	}
1270570
private function executeMethod($method, $args = [])
    {
        if (method_exists($this, $method)) {
            return call_user_func_array([$this, $method], $args);
        }
    }
1166197
protected function getExtraMethodConfig($method)
    {
        // Lazy define methods
        if (!isset(self::$extra_methods[static::class])) {
            $this->defineMethods();
        }

        if (isset(self::$extra_methods[static::class][strtolower($method)])) {
            return self::$extra_methods[static::class][strtolower($method)];
        }
        return null;
    }
1083348
private function addMethod(string $method): void
    {
        if (!HttpMethod::isValid($method)) {
            throw new \InvalidArgumentException("Invalid HTTP request method '$method'");
        }

        $this->methods[] = $method;
    }
1203353
public function setMethod( $method )
	{
		if ( $method == $this->getMethod() ) { return; }

		$this->_values['method'] = (string) $method;
		$this->setModified();
	}
1358594
public function addTemplate(Template $template)
    {
        $key = $this->normalizeKey($template->getTemplateName());
        $this->templates[$key] = $template;
    }
122548
protected function setMethod($method)
    {
        switch (strtoupper($method)) {
            case 'HEAD':
                curl_setopt($this->request, CURLOPT_NOBODY, true);
                break;
            case 'GET':
                curl_setopt($this->request, CURLOPT_HTTPGET, true);
                break;
            case 'POST':
                curl_setopt($this->request, CURLOPT_POST, true);
                break;
            default:
                curl_setopt($this->request, CURLOPT_CUSTOMREQUEST, $method);
        }
    }
23025
public function except($method)
    {
        if (!is_array($method)) {
            $method = [ $method ];
        }

        $this->except += $method;

        return $this;
    }
280902
public function methodsContains($method) {
        if (is_string($method)) {
            $method = array($method);
        }
        $this->rule = "contains";
        $this->method = $method;
        return $this;
    }
1163797
protected function trriggerUnusedMethodError ($method) {
		/** @var $this \MvcCore\Ext\Routers\Modules\IRoute */
		$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;
		trigger_error("[$selfClass] The method `$method` is not used in this extended class.", E_USER_WARNING);
		return $this;
	}
70583
protected function renderMethodBody($method)
    {
        $body = '{';
        $body .= '$arguments = func_get_args();';
        $body .= '$result = $this->__call(__FUNCTION__, $arguments);';

        if ($method->getReturnType() !== 'void') {
            $body .= 'return $result;';
        }

        $body .= '}';

        return $body;
    }
1317070
protected function invokeEngineEvent($method)
    {
        $project = $this->getProjectInstance();
        if ($project instanceof EngineEventInterface) {
            call_user_func_array([$project, $method], []);
        }

        $platform = $this->getPlatformInstance();
        if ($platform instanceof EngineEventInterface) {
            call_user_func_array([$platform, $method], []);
        }
    }
535828
public static function setMethod($method = 'auto')
    {
        if (!\in_array($method, ['auto', 'curl', 'fopen'], true)) {
            $method = 'auto';
        }

        self::$method = $method;

        return new self();
    }