page.changeTemplate:before $page, $template /site/config/config.php return [ 'hooks' => [ 'page.changeTemplate:before' => function ($page, $template) { // your code goes here } ] ]