Skip to content

Kirby 4.2.0

pages()

Helper to build pages collection

pages(array|string ...$id = null): Kirby\Cms\Pages|null

Parameters

Name Type Default
... $id array|string null

Return type

Kirby\Cms\Pages|null

Example

<?php $collection = pages(['home', 'blog']) ?>
<?php $collection = pages([$page, $page->children()->first()]) ?>

The pages() helper fetches published pages only; ids of draft pages are ignored.