class ParserAssetResolverFallback implements AssetResolverInterface

Class ParserAssetResolverFallback

Methods

mixed
resolveAssetURL( string $source, string $file, string $type, ParserInterface $parserInterface, array $filters = array(), bool $debug = false, string $declaredAssetsDirectory = null, mixed $sourceTemplateName = false)

Generate an asset URL

mixed
resolveAssetSourcePath( string $source, string $templateName, string $fileName, ParserInterface $parserInterface)

Return an asset source file path.

Details

at line 38
mixed resolveAssetURL( string $source, string $file, string $type, ParserInterface $parserInterface, array $filters = array(), bool $debug = false, string $declaredAssetsDirectory = null, mixed $sourceTemplateName = false)

Generate an asset URL

Parameters

string $source a module code, or ParserInterface::TEMPLATEASSETSKEY
string $file the file path, relative to a template base directory (e.g. assets/css/style.css)
string $type the asset type, either 'css' or '
ParserInterface $parserInterface the current template parser
array $filters the filters to pass to the asset manager
bool $debug the debug mode
string $declaredAssetsDirectory if not null, this is the assets directory declared in the {declare_assets} function of a template.
mixed $sourceTemplateName A template name, of false. If provided, the assets will be searched in this template directory instead of the current one.

Return Value

mixed

at line 66
mixed resolveAssetSourcePath( string $source, string $templateName, string $fileName, ParserInterface $parserInterface)

Return an asset source file path.

A system of fallback enables file overriding. It will look for the template : - in the current template in directory /modules/{module code}/ - in the module in the current template if it exists - in the module in the default template

Parameters

string $source a module code, or ParserInterface::TEMPLATEASSETSKEY
string $templateName a template name, or false to use the current template
string $fileName the filename
ParserInterface $parserInterface the current template parser

Return Value

mixed the path to directory containing the file, or null if the file doesn't exists.