$kirby->page()
Returns any page from the content folder
$kirby->page(string|null $id = null, Kirby\Cms\Page|Kirby\Cms\Site|null $parent = null, bool $drafts = true): Kirby\Cms\Page|null
Parameters
Name | Type | Default |
---|---|---|
$id | string ornull |
null
|
$parent | Kirby\Cms\Page orKirby\Cms\Site ornull |
null
|
$drafts | bool |
true
|
Return types
Kirby\Cms\Page
ornull
Parent class
Examples
if ($p = $kirby->page('in-the-jungle-of-sumatra', page('notes'))) {
echo 'Pages exists and has status ' . $p->status();
}
While the page()
helper only finds published pages, $kirby->page()
also finds drafts.