certificationy / symfony-pack

A series of questions to prepare for the Symfony certification
https://certification.symfony.com/
MIT License
325 stars 131 forks source link

fix answer on 404 template #53

Closed robertfausk closed 7 years ago

robertfausk commented 7 years ago

see http://symfony.com/doc/current/controller/error_pages.html#overriding-the-default-error-templates

"app/Resources/TwigBundle/views/Exception/error.html.twig" is not valid cause it's for other error codes.

xabbuh commented 7 years ago

The error.html.twig template is a fallback template (i.e. when no template for the specific error code was found). Thus, error404.html.twig will be chosen if it exists, but the controller will fallback to error.html.twig else (see the bulletin points above the paragraph that you quoted).

robertfausk commented 7 years ago

Yep. You're right:)