$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

<?php echo $site->activePage()->title() ?>