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