$site->activePage()

Returns the currently active page object

  • return ($page)

This is the equivalent to the $page variable available in templates and snippets and the new $site->page() method.

Example

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