Created
March 22, 2016 09:32
-
-
Save liverbool/cf288c3eb86aa6f0dd2b to your computer and use it in GitHub Desktop.
bootstrap_4_horizontal_layout.html.twig
This file contains hidden or 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
{% use "web:Form:bootstrap_4_layout.html.twig" %} | |
{# Labels #} | |
{% block form_label -%} | |
{% if label is same as(false) %} | |
<div class="{{ block('form_label_class') }}"></div> | |
{% else %} | |
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ block('form_label_class'))|trim}) %} | |
{{- parent() -}} | |
{% endif %} | |
{%- endblock form_label %} | |
{% block form_label_class -%} | |
col-sm-2 | |
{%- endblock form_label_class %} | |
{# Rows #} | |
{% block form_row -%} | |
<div class="form-group row{% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %}"> | |
{{ form_label(form) }} | |
<div class="{{ block('form_group_class') }}"> | |
{{ form_widget(form) }} | |
{{ form_errors(form) }} | |
</div> | |
</div> | |
{%- endblock form_row %} | |
{% block checkbox_row -%} | |
{{- block('checkbox_radio_row') -}} | |
{%- endblock checkbox_row %} | |
{% block radio_row -%} | |
{{- block('checkbox_radio_row') -}} | |
{%- endblock radio_row %} | |
{% block checkbox_radio_row -%} | |
<div class="form-group row{% if not valid %} has-error{% endif %}"> | |
<div class="{{ block('form_label_class') }}"></div> | |
<div class="{{ block('form_group_class') }}"> | |
{{ form_widget(form) }} | |
{{ form_errors(form) }} | |
</div> | |
</div> | |
{%- endblock checkbox_radio_row %} | |
{% block submit_row -%} | |
<div class="form-group row"> | |
<div class="{{ block('form_label_class') }}"></div> | |
<div class="{{ block('form_group_class') }}"> | |
{{ form_widget(form) }} | |
</div> | |
</div> | |
{% endblock submit_row %} | |
{% block form_group_class -%} | |
col-sm-10 | |
{%- endblock form_group_class %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment