class Runtime

internal  
 

Runtime helpers for Latte.

Methods

__construct(Registry $registry, string|false|null $nonce = null)

No description

Asset|null
resolve(Asset|null $asset, array $options, bool $try)

Resolves an asset reference, passing it through as-is if already an Asset.

string
renderAsset(Asset $asset)

Renders the asset as an HTML import element, including all EntryAsset dependencies.

string
renderAssetPreload(Asset $asset)

Renders the asset as an HTML preload hint element.

string
renderAttributes(Asset $asset, string $tagName, array $usedAttributes)

Renders HTML attributes from the asset's import element, omitting attributes already set on the tag.

Details

at line 26
__construct(Registry $registry, string|false|null $nonce = null)

No description

Parameters

Registry $registry
string|false|null $nonce

at line 40
Asset|null resolve(Asset|null $asset, array $options, bool $try)

Resolves an asset reference, passing it through as-is if already an Asset.

Parameters

Asset|null $asset
array $options
bool $try

Return Value

Asset|null

Exceptions

AssetNotFoundException

at line 54
string renderAsset(Asset $asset)

Renders the asset as an HTML import element, including all EntryAsset dependencies.

Parameters

Asset $asset

Return Value

string

at line 78
string renderAssetPreload(Asset $asset)

Renders the asset as an HTML preload hint element.

Parameters

Asset $asset

Return Value

string

at line 93
string renderAttributes(Asset $asset, string $tagName, array $usedAttributes)

Renders HTML attributes from the asset's import element, omitting attributes already set on the tag.

Adapts to and elements when the asset's native element doesn't match.

Parameters

Asset $asset
string $tagName
array $usedAttributes

Return Value

string