Skip to content

Kirby 5.0.0

$items->prepend()

Prepends an element to the data array

$items->prepend(string|Kirby\Cms\Item ...$args): Kirby\Cms\Items

Parameters

Name Type Default
...$args stringorKirby\Cms\Item no default value

Return type

Kirby\Cms\Items

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

Parent class

Kirby\Cms\Items inherited from Kirby\Cms\Collection

Examples

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