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 %}
|
||||
{% spaceless %}
|
||||
<div class="field inline">
|
||||
{{ form_errors(form) }}
|
||||
<div class="field inline {% spaceless %}
|
||||
{% if errors|length > 0 %}
|
||||
has_error danger
|
||||
{% endif %}
|
||||
{% endspaceless %}">
|
||||
{{ form_label(form) }}
|
||||
{{ form_widget(form) }}
|
||||
{{ form_errors(form) }}
|
||||
</div>
|
||||
{% endspaceless %}
|
||||
{% endblock form_row %}
|
||||
@ -89,7 +93,7 @@
|
||||
{% set label_attr = label_attr|merge({'for': id}) %}
|
||||
{% endif %}
|
||||
{% 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 %}
|
||||
{% if label is empty %}
|
||||
{% set label = name|humanize %}
|
||||
@ -109,6 +113,19 @@
|
||||
{% 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 %}
|
||||
{% spaceless %}
|
||||
|
@ -8,10 +8,6 @@ class DefaultControllerTest extends WebTestCase
|
||||
{
|
||||
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