PHP Class Themosis\Asset\AssetFinder

Show file Open project: themosis/framework Class Usage Examples

Protected Properties

Property Type Description
$extensions array List of URL schemes.

Public Methods

Method Description
addPaths ( array $paths ) Add paths to look for assets.
find ( string $path ) : string Get the full URL path of an asset.

Protected Methods

Method Description
findInPaths ( string $path, array $dirs ) : string Look for an asset file in all registered directories.
isExternal ( string $path ) : boolean Check if a path is external or not.
parsePath ( string $path ) : string Sanitized the given asset path and check if there is a '/' symbol at the beginning of the path.

Method Details

addPaths() public method

Add paths to look for assets.
public addPaths ( array $paths )
$paths array

find() public method

Get the full URL path of an asset.
public find ( string $path ) : string
$path string
return string

findInPaths() protected method

Look for an asset file in all registered directories.
protected findInPaths ( string $path, array $dirs ) : string
$path string The relative path.
$dirs array Registered asset directories.
return string

isExternal() protected method

Check if a path is external or not.
protected isExternal ( string $path ) : boolean
$path string
return boolean

parsePath() protected method

Sanitized the given asset path and check if there is a '/' symbol at the beginning of the path.
protected parsePath ( string $path ) : string
$path string
return string

Property Details

$extensions protected property

List of URL schemes.
protected array $extensions
return array