我正在开发一个集成自定义模板的 Symfony Bundle。 我想覆盖 TwigBundle
error404.html.twig
和 error403.html.twig
文件。
按照here和here的文档,我已经在这个目录中创建了我的文件:
my-bundle/src/Resources/views/bundles/TwigBundle/Exception/error404.html.twig
my-bundle/src/Resources/views/bundles/TwigBundle/Exception/error403.html.twig
但它没有被覆盖。我正在使用 Symfony 5.4.
我用 url 测试:https://parent-project/_error/404
文件需要放在父项目的
templates/
文件夹中,但我想在我的自定义包中覆盖它,这可能吗?