Skip to content
Last updated

WHMCS\View\Template\AssetUtil

Class

AssetUtil

Methods

__construct

public function __construct(TemplateSetInterface $template)

resetCache

public static function resetCache()

factoryThemeUtil

public static function factoryThemeUtil(): self

factoryOrderformUtil

public static function factoryOrderformUtil(): self

assetPaths

public function assetPaths()

assetUrl

public function assetUrl(string $basename, ?string $namespace = null): string

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

TypeNameDescription
string$basename
string|null$namespace

Returns string

assetExists

public function assetExists(string $basename, ?string $namespace = null)

Parameters

TypeNameDescription
string$basename
string|null$namespace

Returns bool\|string — Path or FALSE