A

Asset — Class in namespace Nette\Assets

Represents a web asset (image, script, stylesheet, font, etc.).

AssetNotFoundException — Class in namespace Nette\Assets

Asset cannot be found by a mapper.

AudioAsset — Class in namespace Nette\Assets

Audio asset.

FilesystemMapper::applyVersion() — Method in class FilesystemMapper

Appends a ?v={filemtime} version parameter to the URL.

Registry::addMapper() — Method in class Registry

Registers an asset mapper under the given identifier.

AssetNode — Class in namespace Nette\Bridges\AssetsLatte\Nodes

{asset reference [, attributes]} {preload reference [, attributes]} Renders HTML element for asset with automatic versioning.

$ AssetNode#attributes — Property in class AssetNode
$ NAssetNode#attributes — Property in class NAssetNode

B

DIExtension::beforeCompile() — Method in class DIExtension

C

Helpers::createAssetFromUrl() — Method in class Helpers

Creates an Asset of the appropriate type for the given URL.

Helpers::checkOptions() — Method in class Helpers

Validates an array of options against allowed optional and required keys.

AssetNode::create() — Method in class AssetNode
$ NAssetNode#content — Property in class NAssetNode
NAssetNode::create() — Method in class NAssetNode

D

$ AudioAsset#duration — Property in class AudioAsset

Duration in seconds

Helpers::detectDevServer() — Method in class Helpers

Reads the Vite dev server URL from the given info file, or returns null if unavailable.

DIExtension — Class in namespace Nette\Bridges\AssetsDI

Nette DI extension that registers asset mappers and the asset Registry as container services.

E

EntryAsset — Class in namespace Nette\Assets

Vite entry point asset that carries its CSS imports and JS preloads as dependencies.

F

$ Asset#file — Property in class Asset

The local file path if available

FilesystemMapper — Class in namespace Nette\Assets

Maps asset references to files within a specified local directory.

FontAsset — Class in namespace Nette\Assets

Web font file.

NAssetNode::findUsedAttributes() — Method in class NAssetNode

Collects attributes explicitly set on the HTML element, mapping name to value or true.

G

AudioAsset::getImportElement() — Method in class AudioAsset

Returns the HTML element used to import the asset (img, script, link rel="stylesheet", etc.).

AudioAsset::getPreloadElement() — Method in class AudioAsset

Returns the HTML element used to preload the asset (link rel="preload" or rel="modulepreload").

FilesystemMapper::getAsset() — Method in class FilesystemMapper

Returns the asset for the given relative reference.

FilesystemMapper::getBaseUrl() — Method in class FilesystemMapper
FilesystemMapper::getBasePath() — Method in class FilesystemMapper
FontAsset::getImportElement() — Method in class FontAsset

Returns the HTML element used to import the asset (img, script, link rel="stylesheet", etc.).

FontAsset::getPreloadElement() — Method in class FontAsset

Returns the HTML element used to preload the asset (link rel="preload" or rel="modulepreload").

GenericAsset — Class in namespace Nette\Assets

Asset for file types without a dedicated asset class.

Helpers::guessMimeTypeFromExtension() — Method in class Helpers

Guesses the MIME type from the file extension in the given URL or path, or null if unknown.

Helpers::guessMP3Duration() — Method in class Helpers

Estimates the duration (in seconds) of an MP3 file, assuming constant bitrate (CBR).

HtmlRenderable::getImportElement() — Method in class HtmlRenderable

Returns the HTML element used to import the asset (img, script, link rel="stylesheet", etc.).

HtmlRenderable::getPreloadElement() — Method in class HtmlRenderable

Returns the HTML element used to preload the asset (link rel="preload" or rel="modulepreload").

ImageAsset::getImportElement() — Method in class ImageAsset

Returns the HTML element used to import the asset (img, script, link rel="stylesheet", etc.).

ImageAsset::getPreloadElement() — Method in class ImageAsset

Returns the HTML element used to preload the asset (link rel="preload" or rel="modulepreload").

Mapper::getAsset() — Method in class Mapper

Returns an Asset for the given reference.

Registry::getMapper() — Method in class Registry

Returns the mapper registered under the given identifier.

Registry::getAsset() — Method in class Registry

Returns an Asset for the given qualified reference ('mapper:reference' or ['mapper', 'reference']).

ScriptAsset::getImportElement() — Method in class ScriptAsset

Returns the HTML element used to import the asset (img, script, link rel="stylesheet", etc.).

ScriptAsset::getPreloadElement() — Method in class ScriptAsset

Returns the HTML element used to preload the asset (link rel="preload" or rel="modulepreload").

StyleAsset::getImportElement() — Method in class StyleAsset

Returns the HTML element used to import the asset (img, script, link rel="stylesheet", etc.).

StyleAsset::getPreloadElement() — Method in class StyleAsset

Returns the HTML element used to preload the asset (link rel="preload" or rel="modulepreload").

VideoAsset::getImportElement() — Method in class VideoAsset

Returns the HTML element used to import the asset (img, script, link rel="stylesheet", etc.).

VideoAsset::getPreloadElement() — Method in class VideoAsset

Returns the HTML element used to preload the asset (link rel="preload" or rel="modulepreload").

ViteMapper::getAsset() — Method in class ViteMapper

Returns an Asset for the given Vite entry point or public directory file.

ViteMapper::getBaseUrl() — Method in class ViteMapper
ViteMapper::getBasePath() — Method in class ViteMapper
DIExtension::getConfigSchema() — Method in class DIExtension
LatteExtension::getTags() — Method in class LatteExtension
LatteExtension::getFunctions() — Method in class LatteExtension
LatteExtension::getProviders() — Method in class LatteExtension
AssetNode::getIterator() — Method in class AssetNode
NAssetNode::getIterator() — Method in class NAssetNode

H

Helpers — Class in namespace Nette\Assets

Asset utility functions.

HtmlRenderable — Class in namespace Nette\Assets

Asset renderable as an HTML element.

$ ImageAsset#height — Property in class ImageAsset

I

ImageAsset — Class in namespace Nette\Assets

Image asset.

L

LazyLoad — Class in namespace Nette\Assets

Lazy-loading of properties as a workaround for PHP < 8.4.

DIExtension::loadConfiguration() — Method in class DIExtension
LatteExtension — Class in namespace Nette\Bridges\AssetsLatte

Latte extension that provides asset-related functions and tags:

  • asset(): returns asset URL or throws AssetNotFoundException if asset not found
  • tryAsset(): returns asset URL or null if asset not found
  • {asset ...} renders HTML code
  • {preload ...} renders HTML code for preloading
  • n:asset renders HTML attributes

M

$ AudioAsset#mimeType — Property in class AudioAsset
$ FontAsset#mimeType — Property in class FontAsset
$ GenericAsset#mimeType — Property in class GenericAsset
$ ImageAsset#mimeType — Property in class ImageAsset
Mapper — Class in namespace Nette\Assets

Resolves asset references to Asset objects for a specific storage backend.

N

$ AssetNode#name — Property in class AssetNode
NAssetNode — Class in namespace Nette\Bridges\AssetsLatte\Nodes