class FilesystemMapper implements Mapper

Maps asset references to files within a specified local directory.

Supports configurable versioning and optional extension auto-detection.

Constants

private OptionVersion

Methods

__construct(string $baseUrl, string $basePath, array $extensions = [], bool $versioning = true)

No description

getAsset(string $reference, array $options = [])

Returns the asset for the given relative reference.

string
applyVersion(string $url, string $path)

Appends a ?v={filemtime} version parameter to the URL.

string
getBaseUrl()

No description

string
getBasePath()

No description

Details

at line 17
__construct(string $baseUrl, string $basePath, array $extensions = [], bool $versioning = true)

No description

Parameters

string $baseUrl
string $basePath
array $extensions
bool $versioning

at line 32
Asset getAsset(string $reference, array $options = [])

Returns the asset for the given relative reference.

Tries configured extensions in order and appends a version query parameter if enabled. Supported option: 'version' => bool (overrides the mapper-level versioning setting)

Parameters

string $reference
array $options

mapper-specific options

Return Value

Asset

at line 53
protected string applyVersion(string $url, string $path)

Appends a ?v={filemtime} version parameter to the URL.

Parameters

string $url
string $path

Return Value

string

at line 84
string getBaseUrl()

No description

Return Value

string

at line 90
string getBasePath()

No description

Return Value

string