Thursday 03 November 2016 2:44:13 pm - 4 replies
I try to customize the error pages (404 - not found and 403 - access denied) with ezplatform but I do not understand how it works. I tried to follow the symfony instructions here : http://symfony.com/doc/2.0/cookbook/controller/error_pages.html
... but It does not seem to work.
Could someone explain me how to do this ?
Thursday 16 February 2017 9:38:14 pm
You can override default twig templates in this path : app/Resources/TwigBundle/views/Exception/
Friday 03 March 2017 3:31:02 pm
Thank you for you help. It works !!
However, as all my website is in a separate bundle, I would like to put this overriding files too, in order to keep the same look&feel for error pages.
But I cannot find where.
Actually, I wonder if it is even possible...
I tried :
I declared the TwigBundle as the parent of MyBundle as suggested here https://symfony.com/doc/2.8/bundles/inheritance.html
But nothing works...
Would you have an idea ?
Modified on Friday 03 March 2017 3:31:42 pm by LOBRY Olivier
Saturday 04 March 2017 7:33:45 am
We recently were working with this same problem and developed a solution which provides for the end goals of what your looking for while working within what seems to be a rather nasty case of the limitations of symonfy (atm).
Checkout our solution, https://github.com/brookinsconsulting/BcErrorPagesBundle
In short we provide a script which creates a symbolic link from the installed composer bundle template directory into the app/Resources directory structure. We think this is a simple workaround to the problems you have encountered. BTW, we tried reaching out to others in the symfony chat channel on freenode but at the time of this post did not receive a reply to the question, "Can you store error page template overrides within a bundle" which to date we have not seen any proof that that question has any kind of yes answer except the one we created with BcErrorPagesBundle.
We hope this helps!
You must be logged in to post messages in this topic!