public function register($sType, $sUserFunction, $aOptions)
    {
        if($sType != $this->getName())
        {
            return false;
        }

        if(!is_string($sUserFunction))
        {
            throw new \Jaxon\Exception\Error($this->trans('errors.functions.invalid-declaration'));
        }

        if(is_string($aOptions))
        {
            $aOptions = ['include' => $aOptions];
        }
        if(!is_array($aOptions))
        {
            throw new \Jaxon\Exception\Error($this->trans('errors.functions.invalid-declaration'));
        }

        // Check if an alias is defined
        $sFunctionName = $sUserFunction;
        foreach($aOptions as $sName => $sValue)
        {
            if($sName == 'alias')
            {
                $sFunctionName = $sValue;
                break;
            }
        }

        $this->aFunctions[$sFunctionName] = $aOptions;
        jaxon()->di()->set($sFunctionName, function () use ($sFunctionName, $sUserFunction) {
            $xUserFunction = new \Jaxon\Request\Support\UserFunction($sUserFunction);

            $aOptions = $this->aFunctions[$sFunctionName];
            foreach($aOptions as $sName => $sValue)
            {
                $xUserFunction->configure($sName, $sValue);
            }

            return $xUserFunction;
        });

        return true;
    }