Skip to content

Instantly share code, notes, and snippets.

@crmpicco
Created January 24, 2019 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crmpicco/640a061ad2a52407911ebff45ff22b11 to your computer and use it in GitHub Desktop.
Save crmpicco/640a061ad2a52407911ebff45ff22b11 to your computer and use it in GitHub Desktop.
Bootstrap 3 form_errors block
{% block form_errors -%}
{% if errors|length > 0 -%}
{% if form is not rootform %}<span class="help-block">{% else %}<div class="alert alert-danger">{% endif %}
<ul class="list-unstyled">
{%- for error in errors -%}
<li><span class="glyphicon glyphicon-exclamation-sign"></span> {{ error.message }}</li>
{%- endfor -%}
</ul>
{% if form is not rootform %}</span>{% else %}</div>{% endif %}
{%- endif %}
{%- endblock form_errors %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment