Skip to content

Kirby 5.0.4

$file->asset()

Returns the file asset object. A new object will be created if it doesn't exist yet. The instance will be cached to avoid multiple instantiations, when calling asset methods.

$file->asset(array|string|null $props = null): Kirby\Filesystem\File

Parameters

Name Type Default
$props arrayorstringornull null

Return type

Kirby\Filesystem\File

This method modifies the existing $file object it is applied to and returns it again.

Parent class

Kirby\Cms\File