From e6fcae0cf0e1dbffbe0f37b98597a8727b78ad92 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 1 Apr 2021 23:14:43 +0200 Subject: [PATCH] add error pages --- .env | 1 + config/packages/twig.yaml | 1 + .../TwigBundle/Exception/error.html.twig | 131 ++++++++++++++++++ .../TwigBundle/Exception/error404.html.twig | 7 + .../TwigBundle/Exception/error500.html.twig | 7 + 5 files changed, 147 insertions(+) create mode 100644 templates/bundles/TwigBundle/Exception/error.html.twig create mode 100644 templates/bundles/TwigBundle/Exception/error404.html.twig create mode 100644 templates/bundles/TwigBundle/Exception/error500.html.twig diff --git a/.env b/.env index 745f6aa..f2f40d1 100644 --- a/.env +++ b/.env @@ -36,3 +36,4 @@ MAILER_URL=null://localhost ASSET_BASE_URL=null UMAMI_URL= +GIPHY_API_KEY= diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index c27a966..6ed5a02 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -7,3 +7,4 @@ twig: '%kernel.project_dir%/core/Resources/views/': Core globals: umami_url: '%env(UMAMI_URL)%' + giphy_api_key: '%env(GIPHY_API_KEY)%' diff --git a/templates/bundles/TwigBundle/Exception/error.html.twig b/templates/bundles/TwigBundle/Exception/error.html.twig new file mode 100644 index 0000000..091224e --- /dev/null +++ b/templates/bundles/TwigBundle/Exception/error.html.twig @@ -0,0 +1,131 @@ + + +{% apply spaceless %} + + + + + + Erreur {% block code %}{% endblock %} + + + +
+ + +
+
+ Erreur {{ block('code') }} +
+ +
+ {% block error %}{% endblock %} + +
Aller sur le blog +
+
+ + + + +{% endapply %} diff --git a/templates/bundles/TwigBundle/Exception/error404.html.twig b/templates/bundles/TwigBundle/Exception/error404.html.twig new file mode 100644 index 0000000..df402e9 --- /dev/null +++ b/templates/bundles/TwigBundle/Exception/error404.html.twig @@ -0,0 +1,7 @@ +{% extends 'bundles/TwigBundle/Exception/error.html.twig' %} + +{% block code %}404{% endblock %} + +{% block error %} + Oops! Impossible de trouver cette page… +{% endblock %} diff --git a/templates/bundles/TwigBundle/Exception/error500.html.twig b/templates/bundles/TwigBundle/Exception/error500.html.twig new file mode 100644 index 0000000..9fe7007 --- /dev/null +++ b/templates/bundles/TwigBundle/Exception/error500.html.twig @@ -0,0 +1,7 @@ +{% extends 'bundles/TwigBundle/Exception/error.html.twig' %} + +{% block code %}500{% endblock %} + +{% block error %} + Oops! Il y a eu une erreur… +{% endblock %}