We have a hook called
panel.page.move and it’s triggered if a page (folder) is renamed. We also have the hook
panel.page.update which is triggered when a page is updated.
I’m missing a hook called something like
panel.page.templateChange which should be triggered if a template is changed (file is renamed).
At first it seems like a good idea to only have
panel.page.update because changing a template is a kind of an update. The difference is that with a normal update it changes the content inside the file. When changing the template it rename the file. It’s two different operations.
We also have great methods that reflects the hooks:
But there is no function that I know of that renames the file on a template switch like
$page->changeTemplate('from', 'to', $lang).