I'm building a simple contact form plugin and I would like to be able to provide a default form that the developer can include in his own template.
Most plugins I've seen provide the controller and all the code to process a submitted form but you still have to create your own form.
At the moment I tried 2 methods, using a hook and a template variable. While both work I was wondering if there wasn't a better/cleaner method.
The downside of using a hook is that you can't pass variables to the template (or am I wrong?) and the template variable feels like a misuse of the functionality.
Isn't there a way to use the existing twig import function? Maybe by registering a namespace twig path in the plugin?(https://symfony.com/doc/current/templating/namespaced_paths.html)