PathResolver
class PathResolver (View source)
A class to resolve and manage paths. Paths defined here are allowed to have variables within them.
For example: "files" folder is within the web directory so it is defined as "%web%/files". This allows the web directory to be changed and the files path does not have to be redefined.
Properties
protected array | $paths |
Methods
Default paths for Bolt installation.
No description
Define a path, or really an alias/variable.
Resolve a path.
No description
Returns the raw path definition for the name given.
Returns all path names and their raw definitions.
Returns the names of all paths.
Details
static array
defaultPaths(string $public)
Default paths for Bolt installation.
__construct(string $root, string $themeName = '', string $public = 'public')
void
define(string $name, string $path)
Define a path, or really an alias/variable.
string
resolve(string $path, bool $absolute = true, $additional = null)
Resolve a path.
Examples:
- %web%/files
- A path with variables.
- files
- A previously defined variable.
- foo/bar
- A relative path that will be resolved against the root path.
- /tmp
- An absolute path will be returned as is.
Collection
resolveAll()
string|null
raw(string $name)
Returns the raw path definition for the name given.
array
rawAll()
Returns all path names and their raw definitions.
array
names()
Returns the names of all paths.