Reputation: 31548
I have put the following files in
/app/Resources/TwigBundle/views/Exception
error.html.twig, error.json.twig , error403.json.twig, error404.json.twig
But still i am not able to get those templates
I want it for access denied exception
Token does not have the required roles.
403 Forbidden - AccessDeniedHttpException
1 linked Exception:
AccessDeniedException »
Upvotes: 0
Views: 4553
Reputation: 9846
A more recent update for this. I found that in Symfony 2.8.x, the template you need to override is called exception.html.twig
.
I did so by adding the following file in this path.
app/Resources/TwigBundle/views/Exception/exception.html.twig
You can find the original in this folder here:
vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception
Upvotes: 0
Reputation: 8855
If i were you i'd customize the error403.html.twig
in the following folder app/Resources/TwigBundle/views/Exception/error403.html.twig
I guess you've mistaken the format of this file (json
instead of html
)
Also, make sure that you've cleared the cache (php app/console ca:cl
) and that you are in prod environement.
Upvotes: 2