public function path($name=null)
    {
        if (!$name || in_array($name, ['/', '.', 'root', 'app'])) {
            return $this->path;
        }

        list($scope, $path) = $this->splitNameAndPath($name);

        // If no scope was passed, just return an absolute url appended to root path
        if (!$scope) {
            return $this->path->append($path);
        }

        if (!isset($this->paths[$scope])) {
            throw new KeyNotFoundException("No path found with name '$scope'");
        }

        $url = $this->paths[$scope] instanceof UrlContract ? $this->paths[$scope] : new Url($this->paths[$scope]);

        return $path ? $url->append($path) : $url;

    }
public function path($name=null)
    {
        if (!$name || in_array($name, ['/', '.', 'root', 'app'])) {
            return $this->path;
        }

        list($scope, $path) = $this->splitNameAndPath($name);

        // If no scope was passed, just return an absolute url appended to root path
        if (!$scope) {
            return $this->path->append($path);
        }

        if (!isset($this->paths[$scope])) {
            throw new KeyNotFoundException("No path found with name '$scope'");
        }

        $url = $this->paths[$scope] instanceof UrlContract ? $this->paths[$scope] : new Url($this->paths[$scope]);

        return $path ? $url->append($path) : $url;

    }
public function path ( $ name = null ) { if ( ! $ name || in_array ( $ name , [ '/' , '.' , 'root' , 'app' ] ) ) { return $ this -> path ; } list ( $ scope , $ path ) = $ this -> splitNameAndPath ( $ name ) ; // If no scope was passed, just return an absolute url appended to root path if ( ! $ scope ) { return $ this -> path -> append ( $ path ) ; } if ( ! isset ( $ this -> paths [ $ scope ] ) ) { throw new KeyNotFoundException ( "No path found with name '$scope'" ) ; } $ url = $ this -> paths [ $ scope ] instanceof UrlContract ? $ this -> paths [ $ scope ] : new Url ( $ this -> paths [ $ scope ] ) ; return $ path ? $ url -> append ( $ path ) : $ url ; }
This is a method to retrieve paths of the application.
Without any parameter it returns the root path. This is
typically a directory root with a public folder.

This path is setted in __construct() and cannot be changed.

To get any other path, just pass a name or an url.


@param string                    $name (optional)

@return \Ems\Contracts\Core\Url
This is a method to retrieve paths of the application . Without any parameter it returns the root path . This is typically a directory root with a public folder .