src/Url/Url.php
public static function get($pUrl, $pParams = array(), $pRelative = true)
    {
        if (strpos($pUrl, '*/') !== false) {
            if (self::$_request === NULL) {
                self::setRequest();
            }

            $pUrl = str_replace('*/*/', self::$_request->getModule() . DS . self::$_request->getView(), $pUrl);
            $pUrl = str_replace('*/', self::$_request->getModule() . DS, $pUrl);
        }

        if (Agl::isModuleLoaded(Agl::AGL_MORE_POOL . '/locale/locale')) {
            return Agl::getSingleton(Agl::AGL_MORE_POOL . '/locale')->getUrl($pUrl, $pParams, $pRelative);
        }

        if (! $pUrl) {
            if ($pRelative) {
                return ROOT;
            }
            return self::getHost(ROOT);
        }

        if (strpos($pUrl, Agl::APP_PUBLIC_DIR) === false) {
            if (is_array($pParams) and ! empty($pParams)) {
                $params = array();
                foreach ($pParams as $key => $value) {
                    $params[] = $key . DS . $value;
                }

                $url = $pUrl . DS . implode(DS, $params) . DS;
            } else if (is_string($pParams) and $pParams) {
                $url = $pUrl . DS . $pParams . DS;
            } else {
                $url = $pUrl . DS;
            }

            if ($pRelative) {
                return ROOT . $url;
            }

            return self::getHost(ROOT . $url);
        }

        if ($pRelative) {
            return ROOT . $pUrl;
        }
        return self::getHost(ROOT . $pUrl);
    }
public static function get($pUrl, $pParams = array(), $pRelative = true)
    {
        if (strpos($pUrl, '*/') !== false) {
            if (self::$_request === NULL) {
                self::setRequest();
            }

            $pUrl = str_replace('*/*/', self::$_request->getModule() . DS . self::$_request->getView(), $pUrl);
            $pUrl = str_replace('*/', self::$_request->getModule() . DS, $pUrl);
        }

        if (Agl::isModuleLoaded(Agl::AGL_MORE_POOL . '/locale/locale')) {
            return Agl::getSingleton(Agl::AGL_MORE_POOL . '/locale')->getUrl($pUrl, $pParams, $pRelative);
        }

        if (! $pUrl) {
            if ($pRelative) {
                return ROOT;
            }
            return self::getHost(ROOT);
        }

        if (strpos($pUrl, Agl::APP_PUBLIC_DIR) === false) {
            if (is_array($pParams) and ! empty($pParams)) {
                $params = array();
                foreach ($pParams as $key => $value) {
                    $params[] = $key . DS . $value;
                }

                $url = $pUrl . DS . implode(DS, $params) . DS;
            } else if (is_string($pParams) and $pParams) {
                $url = $pUrl . DS . $pParams . DS;
            } else {
                $url = $pUrl . DS;
            }

            if ($pRelative) {
                return ROOT . $url;
            }

            return self::getHost(ROOT . $url);
        }

        if ($pRelative) {
            return ROOT . $pUrl;
        }
        return self::getHost(ROOT . $pUrl);
    }
public static function get ( $ pUrl , $ pParams = array ( ) , $ pRelative = true ) { if ( strpos ( $ pUrl , '*/' ) !== false ) { if ( self :: $ _request === NULL ) { self :: setRequest ( ) ; } $ pUrl = str_replace ( '*/*/' , self :: $ _request -> getModule ( ) . DS . self :: $ _request -> getView ( ) , $ pUrl ) ; $ pUrl = str_replace ( '*/' , self :: $ _request -> getModule ( ) . DS , $ pUrl ) ; } if ( Agl :: isModuleLoaded ( Agl :: AGL_MORE_POOL . '/locale/locale' ) ) { return Agl :: getSingleton ( Agl :: AGL_MORE_POOL . '/locale' ) -> getUrl ( $ pUrl , $ pParams , $ pRelative ) ; } if ( ! $ pUrl ) { if ( $ pRelative ) { return ROOT ; } return self :: getHost ( ROOT ) ; } if ( strpos ( $ pUrl , Agl :: APP_PUBLIC_DIR ) === false ) { if ( is_array ( $ pParams ) and ! empty ( $ pParams ) ) { $ params = array ( ) ; foreach ( $ pParams as $ key => $ value ) { $ params [ ] = $ key . DS . $ value ; } $ url = $ pUrl . DS . implode ( DS , $ params ) . DS ; } else if ( is_string ( $ pParams ) and $ pParams ) { $ url = $ pUrl . DS . $ pParams . DS ; } else { $ url = $ pUrl . DS ; } if ( $ pRelative ) { return ROOT . $ url ; } return self :: getHost ( ROOT . $ url ) ; } if ( $ pRelative ) { return ROOT . $ pUrl ; } return self :: getHost ( ROOT . $ pUrl ) ; }
Return a formated URL with module, view, action and parameters.

@param string $pUrl URL to get (module/view)
@param string|array $pParams Parameters to include into the request
@param bool $pRelative Create a relative URL
@return string
Return a formated URL with module view action and parameters .