Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen:
Displaying errors in Expressive with Twig
Oct 19, 2017 @ 17:47:36

Rob Allen has a quick post for the Twig and Zend Expressive users out there showing how to display errors if you're not using the Whoops error handler.

If you're not using the Whoops error handler with Expressive and are using the Twig renderer, then you are given no information about the problem that occurred, even in debug mode.

He includes the Twig template to output the error message and, if the application is in "debug" mode, show an optional block of extra information. This provides details about the exception thrown and some of the previous errors. The previous errors are looped about output to provide more context around the failure.

tagged: error twig zend zendexpressive tutorial output debug

Link: https://akrabat.com/displaying-errors-in-expressive-with-twig/


Trending Topics: