Hi All,
In previous version of PS, I could render a smarty template from a hook like:
$this->context->smarty->assign(array(
...
));
return $this->display(__FILE__, 'assets-customers.tpl');
and the view file would be placed in modules\foo\views\templates\hook\assets-customers.tpl
The page https://devdocs.prestashop.com/1.7/modules/concepts/hooks/use-hooks-on-modern-pages/ tells us the new styntax for rendering a twig template:
return $this->get('twig')->render('assets-customers.twig',[
...
]);
But it doesn't give any clues as to where the template file should live?
I've tried it in modules\foo\, modules\foo\views\ & modules\foo\views\templates\hook\ but I awlays get
Template "assets-customers.twig" is not defined.
Can anyone share a working example of using a Twig template from a hook in a module pls? (Not overriding a built-in template)
Thanks!