Greetings to all processwire fans,
I am new in processwire and I have used it since 3 weeks. Probably it's a really silly question but does someone now how I can execute a function in my own module, which is triggered when I save a pages, which contains a user-defined template. I tried to to this with an basic if/else condition to trigger the hook when the page has theTemplateName== "". Unfortunately it doesn't work. So I try this which might be the wrong Syntax. Perhaps someone can give me a hint THANKS a lot!
public function init() {
// add a hook after the $pages->save, to issue a notice every time a page is saved
$this->page->template == "templateName"->addHookAfter('save', $this, 'example1');
}