Example #1
0
/**
 * Return the value adding request uri to the getSiteUrl() To get the full url
 *
 * @return string
 */
function getFullSiteUrl()
{
    $num_args = func_num_args();
    $args_list = func_get_args();
    $request_uri = Context::getRequestUri();
    if (!$num_args) {
        return $request_uri;
    }
    $domain = array_shift($args_list);
    $num_args = count($args_list);
    $url = Context::getUrl($num_args, $args_list, $domain);
    if (strncasecmp('http', $url, 4) !== 0) {
        preg_match('/^(http|https):\\/\\/([^\\/]+)\\//', $request_uri, $match);
        return substr($match[0], 0, -1) . $url;
    }
    return $url;
}
 function getNotEncodedFullUrl()
 {
     $num_args = func_num_args();
     $args_list = func_get_args();
     $request_uri = Context::getRequestUri();
     if (!$num_args) {
         return $request_uri;
     }
     $url = Context::getUrl($num_args, $args_list, null, false);
     if (!preg_match('/^http/i', $url)) {
         preg_match('/^(http|https):\\/\\/([^\\/]+)\\//', $request_uri, $match);
         $url = Context::getUrl($num_args, $args_list, null, false);
         return substr($match[0], 0, -1) . $url;
     }
     return $url;
 }