Skip to content

Kirby 5.1.2

$assets->prepend()

Prepends an element to the data array

$assets->prepend(string|Kirby\Plugin\Asset ...$args): Kirby\Plugin\Assets

Parameters

Name Type Default
...$args stringorKirby\Plugin\Asset no default value

Return type

Kirby\Plugin\Assets

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

Parent class

Kirby\Plugin\Assets inherited from Kirby\Cms\Collection

Examples

$collection->prepend($object);
$collection->prepend('key', $object);