pages()
Helper to build pages collection
pages(string|array $id = null): Kirby\Cms\Pages|null
Parameters
| Name | Type | Default |
|---|---|---|
| $id | string|array |
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.