Skip to content

Instantly share code, notes, and snippets.

@vjnrv
Last active October 2, 2015 09:07
Show Gist options
  • Save vjnrv/2216177 to your computer and use it in GitHub Desktop.
Save vjnrv/2216177 to your computer and use it in GitHub Desktop.
Symfony2 simple custom error page
{# app/Resources/TwigBundle/views/Exception/error.html.twig #}
{% extends '::layout.html.twig' %}
{% block title %}
Erro {{ status_code }}
{% endblock %}
{% block content %}
{% if status_code == '404' %}
<h1>Página não encontrada</h1>
{% else %}
<h1>Erro inesperado</h1>
<p>
{{ exception.message|e|replace({"\n": '<br />'})|format_file_from_text }}
</p>
<div>
<strong>{{ status_code }}</strong> {{ status_text }} - {{ exception.class|abbr_class }}
</div>
{% endif %}
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment