ModuleResource
class ModuleResource
This object represents a single resource file attached to a module, and can be used as a reference to this to be later turned into either a URL or file path.
Methods
Return the full filesystem path to this resource.
Get the path of this resource relative to the base path.
Public URL to this resource.
Synonym for getURL() for APIs that expect a Link method
Determine if this resource exists
Get relative path
Get nested resource relative to this.
Details
at line 40
__construct(Module $module, string $relativePath)
ModuleResource constructor.
at line 57
string
getPath()
Return the full filesystem path to this resource.
Note: In the case that this resource is mapped to the _resources
folder, this will
return the original rather than the copy / symlink.
at line 70
string
getRelativePath()
Get the path of this resource relative to the base path.
Note: In the case that this resource is mapped to the _resources
folder, this will
return the original rather than the copy / symlink.
at line 89
string
getURL()
Public URL to this resource.
Note: May be either absolute url, or root-relative url
In the case that this resource is mapped to the _resources
folder this
will be the mapped url rather than the original path.
at line 101
mixed
Link()
Synonym for getURL() for APIs that expect a Link method
at line 111
bool
exists()
Determine if this resource exists
at line 121
string
__toString()
Get relative path
at line 129
Module
getModule()
at line 141
ModuleResource
getRelativeResource(string $path)
Get nested resource relative to this.
Note: Doesn't support ..
or .
relative syntax