Reference

Guide

$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 $path = null): Page|null

Parameters

Name Type Default Description
$path string null

Return type

Page|null

Example

Fetching the current page

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

Fetching any subpage

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

Source code

kirby/src/Cms/Site.php#L396