Symfony 2.6 Error Page Preview Feature

By am 10.12.2014 in Blog, Symfony

Have you, too, hacked up some solution to test the different error pages your customers will see for Error 404, 500 etc.?

Symfony 2.6 comes with a great new Feature for previewing error pages.

All you need to do to profit from this is to import a routing file in app/config/routing_dev.yml like this:

    resource: "@TwigBundle/Resources/...
        ... config/routing/errors.xml"
    prefix:   /_error

To preview the error pages, open up:

The Format Parameter is optional. With it you can not only check HTML error responses but also the ones for JSON and XML.


Kommentare bitte per Twitter an @PHP_Schulung senden.