pages()
Helper to build pages collection
pages(array|string ...$id): Kirby\Cms\Pages|null
Parameters
| Name | Type | Default |
|---|---|---|
| ...$id | arrayorstring |
no default value |
Return types
Kirby\Cms\Pagesornull
Examples
<?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.