Skip to content

Kirby 6.0.0

$pages->merge()

Include all given items in the collection

$pages->merge(Pages|Page|array|string ...$args): Pages

Parameters

Name Type Default Description
...$args Kirby\Cms\PagesorKirby\Cms\Pageorarrayorstring no default value Pages, collections or page IDs (also in arrays); 'drafts' merges the drafts of the parent

Return types

Kirby\Cms\Pages

This method does not modify the existing $pages object but returns a new object with the changes applied. Learn more →

Parent class

Kirby\Cms\Pages

Examples

$collection1   = page('exhibitions')->children()->listed();
$collection2   = page('news')->children()->listed();
$newCollection = $collection1->merge($collection2);