这是我的页面:error404.html.twig 作为文档示例 404 错误模板
{# templates/bundles/TwigBundle/Exception/error404.html.twig #}
{% extends 'base.html.twig' %}
{% block body %}
<h1>Page not found</h1>
<p>
The requested page couldn't be located. Checkout for any URL
misspelling or <a href="{{ path('homepage') }}">return to the homepage</a>.
</p>
{% endblock %}
Run Code Online (Sandbox Code Playgroud)
这是我的页面 config/routes/dev/twig.yaml
# config/routes/dev/twig.yaml
_errors:
resource: '@TwigBundle/Resources/config/routing/errors.xml'
prefix: /_error
Run Code Online (Sandbox Code Playgroud)
这是我的页面 config/packages/twig.yaml
# config/packages/twig.yaml
twig:
exception_controller: App\Controller\ExceptionController::showException
Run Code Online (Sandbox Code Playgroud)
我应该做什么才能让它发挥作用?