AssetsHelper
extends Helper
in package
AssetsHelper helps manage asset URLs.
Tags
Table of Contents
- $packages : mixed
- __construct() : mixed
- getName() : mixed
- {@inheritdoc}
- getUrl() : string
- Returns the public url/path of an asset.
- getVersion() : string
- Returns the version of an asset.
Properties
$packages
private
mixed
$packages
Methods
__construct()
public
__construct(Packages $packages) : mixed
Parameters
- $packages : Packages
Return values
mixed —getName()
{@inheritdoc}
public
getName() : mixed
Return values
mixed —getUrl()
Returns the public url/path of an asset.
public
getUrl(string $path[, string $packageName = null ]) : string
If the package used to generate the path is an instance of UrlPackage, you will always get a URL and not a path.
Parameters
- $path : string
-
A public path
- $packageName : string = null
-
The name of the asset package to use
Return values
string —The public path of the asset
getVersion()
Returns the version of an asset.
public
getVersion(string $path[, string $packageName = null ]) : string
Parameters
- $path : string
-
A public path
- $packageName : string = null
-
The name of the asset package to use
Return values
string —The asset version