src/Foundation/Application.php
public function url($path = null)
    {
        $config = $this->make('flarum.config');
        $url = array_get($config, 'url', array_get($_SERVER, 'REQUEST_URI'));

        if (is_array($url)) {
            if (isset($url[$path])) {
                return $url[$path];
            }

            $url = $url['base'];
        }

        if ($path) {
            $url .= '/'.array_get($config, "paths.$path", $path);
        }

        return $url;
    }
public function url($path = null)
    {
        $config = $this->make('flarum.config');
        $url = array_get($config, 'url', array_get($_SERVER, 'REQUEST_URI'));

        if (is_array($url)) {
            if (isset($url[$path])) {
                return $url[$path];
            }

            $url = $url['base'];
        }

        if ($path) {
            $url .= '/'.array_get($config, "paths.$path", $path);
        }

        return $url;
    }
public function url ( $ path = null ) { $ config = $ this -> make ( 'flarum.config' ) ; $ url = array_get ( $ config , 'url' , array_get ( $ _SERVER , 'REQUEST_URI' ) ) ; if ( is_array ( $ url ) ) { if ( isset ( $ url [ $ path ] ) ) { return $ url [ $ path ] ; } $ url = $ url [ 'base' ] ; } if ( $ path ) { $ url .= '/' . array_get ( $ config , "paths.$path" , $ path ) ; } return $ url ; }
Get the URL to the Flarum installation.

@param string $path
@return string
Get the URL to the Flarum installation .