Twig module author extensions (#4715)
commit81f407fbc3cf43b017272b555b9d9939b9216033
authorStephen Nielson <stephen@nielson.org>
Mon, 8 Nov 2021 14:36:45 +0000 (8 09:36 -0500)
committerGitHub <noreply@github.com>
Mon, 8 Nov 2021 14:36:45 +0000 (8 09:36 -0500)
tree34c0e5dd7a78ded22ac622f9d31976edd57b8f63
parentf645f54368578f4a6369c3887fa354098eed242e
Twig module author extensions (#4715)

* Twig module author extensions

Added a twig extension to fire a generic event.  For now that is helpful
in being able to migrate over some of our php/html files that dispatch
render events.

I also added a twig environment event that module authors can hook into
in order to extend the file loader and load their own template files.  I
put an example in the twig environment event header of how to go about
doing this.

Also created some generic error handler pages with an example 400 page
so we can start having nicer looking error handling pages for when
things go wrong in OpenEMR.

* Fix spacing and imports
src/Common/Twig/TwigContainer.php
src/Common/Twig/TwigExtension.php
src/Events/Core/TwigEnvironmentEvent.php [new file with mode: 0644]
templates/error/400.html.twig [new file with mode: 0644]
templates/error/general_http_error.html.twig [new file with mode: 0644]