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'] 'name' => $config['installation_name']
), ),
'date_format' => 'd-M-Y' 'date_format' => 'd-M-Y'
) ),
'form' => array(
'resources' => array('ChillMainBundle:Form:fields.html.twig'))
); );
$container->prependExtensionConfig('twig', $twigConfig); $container->prependExtensionConfig('twig', $twigConfig);
} }
} }

View File

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