Skip to content

Kirby 5.0.0

$blocks->prepend()

Prepends an element to the data array

$blocks->prepend(string|Kirby\Cms\Block ...$args): Kirby\Cms\Blocks

Parameters

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

Return type

Kirby\Cms\Blocks

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

Parent class

Kirby\Cms\Blocks inherited from Kirby\Cms\Collection

Examples

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