Skip to content

Kirby 5.1.1

$collection->add()

Adds a single object or an entire second collection to the current collection

$collection->add(Kirby\Cms\Collection|TValue|array $object): Kirby\Cms\Collection

Parameters

Name Type Default
$objectrequired Kirby\Cms\CollectionorTValueorarray no default value

Return type

Kirby\Cms\Collection

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

Parent class

Kirby\Cms\Collection