Skip to content

Commit 8b746b6

Browse files
committed
use font-awesome icon in "form_errors" block
1 parent 21f82cc commit 8b746b6

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{% extends 'bootstrap_3_layout.html.twig' %}
2+
3+
{# Errors #}
4+
5+
{% block form_errors -%}
6+
{% if errors|length > 0 -%}
7+
{% if form.parent %}<span class="help-block">{% else %}<div class="alert alert-danger">{% endif %}
8+
<ul class="list-unstyled">
9+
{%- for error in errors -%}
10+
{# use font-awesome icon library #}
11+
<li><span class="fa fa-exclamation-triangle"></span> {{ error.message }}</li>
12+
{%- endfor -%}
13+
</ul>
14+
{% if form.parent %}</span>{% else %}</div>{% endif %}
15+
{%- endif %}
16+
{%- endblock form_errors %}

app/config/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ twig:
5555
debug: "%kernel.debug%"
5656
strict_variables: "%kernel.debug%"
5757
form_themes:
58-
- "bootstrap_3_layout.html.twig"
58+
- "form/layout.html.twig"
5959
- "form/fields.html.twig"
6060

6161
# Doctrine Configuration (used to access databases and manipulate their information)
6262
doctrine:
6363
dbal:
6464
# if you don't want to use SQLite, change the URL in parameters.yml or set the DATABASE_URL environment variable
6565
url: "%env(DATABASE_URL)%"
66-
66+
6767
# instead of using a URL, you may also uncomment the following lines to configure your database
6868
# driver: pdo_mysql
6969
# host: "%database_host%"

0 commit comments

Comments
 (0)