public function asset($uri = null)
    {
        if (empty($uri)) {
            // Allow empty
        } elseif (substr($uri, 0, 7) == "http://"
            || substr($uri, 0, 8) == "https://"
            || substr($uri, 0, 2) == "//"
        ) {
            // Fully qualified, just leave as is.
            return rtrim($uri, '/');
        } elseif ($uri[0] == '/') {
            // Absolute url, prepend with staticSiteUrl
            return rtrim($this->staticSiteUrl . rtrim($uri, '/'), '/');
        }

        $baseUrl = isset($this->staticBaseUrl)
            ? $this->staticBaseUrl
            : $this->baseUrl;

        return empty($uri)
            ? $baseUrl
            : $baseUrl . '/' . $uri;
    }
public function asset($uri = null)
    {
        if (empty($uri)) {
            // Allow empty
        } elseif (substr($uri, 0, 7) == "http://"
            || substr($uri, 0, 8) == "https://"
            || substr($uri, 0, 2) == "//"
        ) {
            // Fully qualified, just leave as is.
            return rtrim($uri, '/');
        } elseif ($uri[0] == '/') {
            // Absolute url, prepend with staticSiteUrl
            return rtrim($this->staticSiteUrl . rtrim($uri, '/'), '/');
        }

        $baseUrl = isset($this->staticBaseUrl)
            ? $this->staticBaseUrl
            : $this->baseUrl;

        return empty($uri)
            ? $baseUrl
            : $baseUrl . '/' . $uri;
    }
public function asset ( $ uri = null ) { if ( empty ( $ uri ) ) { // Allow empty } elseif ( substr ( $ uri , 0 , 7 ) == "http://" || substr ( $ uri , 0 , 8 ) == "https://" || substr ( $ uri , 0 , 2 ) == "//" ) { // Fully qualified, just leave as is. return rtrim ( $ uri , '/' ) ; } elseif ( $ uri [ 0 ] == '/' ) { // Absolute url, prepend with staticSiteUrl return rtrim ( $ this -> staticSiteUrl . rtrim ( $ uri , '/' ) , '/' ) ; } $ baseUrl = isset ( $ this -> staticBaseUrl ) ? $ this -> staticBaseUrl : $ this -> baseUrl ; return empty ( $ uri ) ? $ baseUrl : $ baseUrl . '/' . $ uri ; }
Create an url for a static asset.

@param string $uri part of uri to use when creating an url.

@return string as resulting url.
Create an url for a static asset .