Skip to content

Kirby 5.0.4

$site->page()

Returns the current page if $path is not specified. Otherwise it will try to find a page by the given path.

$site->page(string|null $path = null): Kirby\Cms\Page|null

Parameters

Name Type Default Description
$path stringornull null omit for current page,
otherwise e.g. notes/across-the-ocean

Return types

Kirby\Cms\Pageornull

This method modifies the existing $site object it is applied to and returns it again.

Parent class

Kirby\Cms\Site

Examples

Fetching the current page

<?= $site->page()->title() ?>

Fetching any subpage

<?= $site->page('some/sub/page/deep/down')->title() ?>