$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 | stringornull |
null
|
| $parent | Kirby\Cms\PageorKirby\Cms\Siteornull |
null
|
| $drafts | bool |
true
|
Return types
Kirby\Cms\Pageornull
This method modifies the existing $app object it is applied to and returns it again.
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.