FilesystemMapper
class FilesystemMapper implements Mapper
Maps asset references to files within a specified local directory.
Supports versioning based on file modification time and optional extension auto-detection.
Methods
No description
Resolves a relative reference to a asset within the configured base path.
Constructs the full public URL by prepending the base URL to the reference.
Constructs the full filesystem path by prepending the base path to the reference.
Builds the final public URL, potentially including a version query parameter.
Determines the version string for an asset, typically based on file modification time.
Appends the version string to the URL as a query parameter '?v=...'.
Details
at line 14
__construct(string $baseUrl, string $basePath, array $extensions = [])
No description
at line 28
Asset
getAsset(string $reference, array $options = [])
Resolves a relative reference to a asset within the configured base path.
Attempts to find a matching extension if configured.
at line 45
string
resolveUrl(string $reference)
Constructs the full public URL by prepending the base URL to the reference.
at line 54
string
resolvePath(string $reference)
Constructs the full filesystem path by prepending the base path to the reference.
at line 63
protected string
buildUrl(string $reference, array $options)
Builds the final public URL, potentially including a version query parameter.
at line 76
protected string|null
getVersion(string $reference)
Determines the version string for an asset, typically based on file modification time.
at line 86
protected string
applyVersion(string $url, string $version)
Appends the version string to the URL as a query parameter '?v=...'.