Created
April 15, 2013 22:52
-
-
Save jigante/5391959 to your computer and use it in GitHub Desktop.
Snippet: TWIG - Horizontal form fields rendering with twitter bootstrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% block form_row %} | |
{% spaceless %} | |
<div class="control-group {% if errors %}error{% endif %}"> | |
{{ form_label(form, label|default(null), { 'label_attr': {'class': 'control-label'} }) }} | |
<div class="controls"> | |
{{ form_widget(form) }} | |
{{ form_errors(form) }} | |
</div> | |
</div> | |
{% endspaceless %} | |
{% endblock form_row %} | |
{% block form_errors %} | |
{% spaceless %} | |
{% if errors|length > 0 %} | |
<ul> | |
{% for error in errors %} | |
<li class="help-inline">{{ error.message }}</li> | |
{% endfor %} | |
</ul> | |
{% endif %} | |
{% endspaceless %} | |
{% endblock form_errors %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment