Form rendering

This commit is contained in:
Marc Ducobu 2014-11-11 09:29:56 +01:00
parent 76151a6013
commit a71782f9af
2 changed files with 11 additions and 13 deletions

View File

@ -55,10 +55,10 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface
'name' => $config['installation_name']
),
'date_format' => 'd-M-Y'
)
),
'form' => array(
'resources' => array('ChillMainBundle:Form:fields.html.twig'))
);
$container->prependExtensionConfig('twig', $twigConfig);
}
}

View File

@ -1,20 +1,19 @@
{% block form_row %}
{% spaceless %}
<div class="field inline {% spaceless %}
<div class="grid-4 {#{% spaceless %}
{% if errors|length > 0 %}
has_error danger
{% endif %}
{% endspaceless %}">
{{ form_label(form) }}
{{ form_widget(form) }}
{{ form_errors(form) }}
</div>
{% endspaceless %}">#}">
{{ form_label(form) }}
</div>
<div class="grid-8">
{{ form_widget(form) }}
{{ form_errors(form) }}
</div>
{% endspaceless %}
{% endblock form_row %}
{% block form_widget_simple %}
{% spaceless %}
{% if attr.class is not defined %}
@ -69,7 +68,6 @@ has_error danger
{% endspaceless %}
{% endblock choice_widget_expanded %}
{% block date_widget %}
{% spaceless %}
{% if widget == 'single_text' %}