AssetUtil

class AssetUtil

Methods summary

Return Type Method Name Description
__construct(TemplateSetInterface $template) -
static  resetCache() -
void cachePath(string $templateName, string $namespace, string $basename, string $path) -
void cacheDisk(string $templateName, string $namespace, string $basename, bool $exists = false) -
bool isCached(string $namespace, string $basename) -
bool|null onDiskStatus(string $namespace, string $basename) -
string cachedValue(string $namespace, string $basename) -
exists(string $namespace, string $basename) -
static AssetUtil factoryThemeUtil() -
static AssetUtil factoryOrderformUtil() -
assetPaths() -
string assetUrl(string $basename, string|null $namespace = null) Retrieve best URL path of asset
bool|string assetExists(string $basename, string|null $namespace = null) -

Details

__construct (TemplateSetInterface $template)

Parameters

TemplateSetInterface $template

static resetCache ()

protected void cachePath (string $templateName, string $namespace, string $basename, string $path)

Parameters

string $templateName
string $namespace
string $basename
string $path

Return Value

void

protected void cacheDisk (string $templateName, string $namespace, string $basename, bool $exists = false)

Parameters

string $templateName
string $namespace
string $basename
bool $exists

Return Value

void

protected bool isCached (string $namespace, string $basename)

Parameters

string $namespace
string $basename

Return Value

bool

protected bool|null onDiskStatus (string $namespace, string $basename)

Parameters

string $namespace
string $basename

Return Value

bool|null

protected string cachedValue (string $namespace, string $basename)

Parameters

string $namespace
string $basename

Return Value

string

protected exists (string $namespace, string $basename)

Parameters

string $namespace
string $basename

static AssetUtil factoryThemeUtil ()

Return Value

AssetUtil

static AssetUtil factoryOrderformUtil ()

Return Value

AssetUtil

assetPaths ()

string assetUrl (string $basename, string|null $namespace = null)

Retrieve best URL path of asset

Value will be based on the template's configuration, the existence of the named asset on disk, any configured parent. If it doesn't exist at the explicitly name place or within the parent, a default concoction will be provided based on the name space (or the parent's named space if a parent is defined). Do as I mean.

Parameters

string $basename
string|null $namespace

Return Value

string

bool|string assetExists (string $basename, string|null $namespace = null)

Parameters

string $basename
string|null $namespace

Return Value

bool|string Path or FALSE