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 = [])

Resolves a relative reference to an asset within the configured base path.

string
applyVersion(string $url, string $path)

No description

string
getBaseUrl()

Returns the base URL for this mapper.

string
getBasePath()

Returns the base path for this mapper.

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 31
Asset getAsset(string $reference, array $options = [])

Resolves a relative reference to an asset within the configured base path.

Attempts to find a matching extension if configured and applies versioning if enabled. Available options: 'version' => bool: Whether to apply versioning (defaults to true)

Parameters

string $reference
array $options

Return Value

Asset

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

No description

Parameters

string $url
string $path

Return Value

string

at line 83
string getBaseUrl()

Returns the base URL for this mapper.

Return Value

string

at line 92
string getBasePath()

Returns the base path for this mapper.

Return Value

string