mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
add errors in labels
This commit is contained in:
parent
c46a02acb3
commit
f5655fc21b
@ -2,10 +2,14 @@
|
|||||||
|
|
||||||
{% block form_row %}
|
{% block form_row %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
<div class="field inline">
|
<div class="field inline {% spaceless %}
|
||||||
{{ form_errors(form) }}
|
{% if errors|length > 0 %}
|
||||||
|
has_error danger
|
||||||
|
{% endif %}
|
||||||
|
{% endspaceless %}">
|
||||||
{{ form_label(form) }}
|
{{ form_label(form) }}
|
||||||
{{ form_widget(form) }}
|
{{ form_widget(form) }}
|
||||||
|
{{ form_errors(form) }}
|
||||||
</div>
|
</div>
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
{% endblock form_row %}
|
{% endblock form_row %}
|
||||||
@ -89,7 +93,7 @@
|
|||||||
{% set label_attr = label_attr|merge({'for': id}) %}
|
{% set label_attr = label_attr|merge({'for': id}) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if required %}
|
{% if required %}
|
||||||
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('inline ') ~ ' required')|trim}) %}
|
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if label is empty %}
|
{% if label is empty %}
|
||||||
{% set label = name|humanize %}
|
{% set label = name|humanize %}
|
||||||
@ -109,6 +113,19 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block form_errors %}
|
||||||
|
{% spaceless %}
|
||||||
|
{% if errors|length > 0 %}
|
||||||
|
<ul class="errors">
|
||||||
|
{% for error in errors %}
|
||||||
|
<li>{{ error.message }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
{% endspaceless %}
|
||||||
|
{% endblock form_errors %}
|
||||||
|
|
||||||
|
|
||||||
{#
|
{#
|
||||||
{% block widget_attributes %}
|
{% block widget_attributes %}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
|
@ -8,10 +8,6 @@ class DefaultControllerTest extends WebTestCase
|
|||||||
{
|
{
|
||||||
public function testIndex()
|
public function testIndex()
|
||||||
{
|
{
|
||||||
$client = static::createClient();
|
|
||||||
|
|
||||||
$crawler = $client->request('GET', '/hello/Fabien');
|
|
||||||
|
|
||||||
$this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user