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