[ Index ]

PHP Cross Reference of phpBB-3.3.11-deutsch

title

Body

[close]

/vendor/symfony/twig-bridge/Resources/views/Form/ -> bootstrap_3_layout.html.twig (source)

   1  {% use "bootstrap_base_layout.html.twig" %}
   2  
   3  {# Widgets #}
   4  
   5  {% block form_widget_simple -%}
   6      {% if type is not defined or type not in ['file', 'hidden'] %}
   7          {%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control')|trim}) -%}
   8      {% endif %}
   9      {{- parent() -}}
  10  {%- endblock form_widget_simple %}
  11  
  12  {% block button_widget -%}
  13      {%- set attr = attr|merge({class: (attr.class|default('btn-default') ~ ' btn')|trim}) -%}
  14      {{- parent() -}}
  15  {%- endblock button_widget %}
  16  
  17  {% block money_widget -%}
  18      {% set prepend = not (money_pattern starts with '{{') %}
  19      {% set append = not (money_pattern ends with '}}') %}
  20      {% if prepend or append %}
  21          <div class="input-group">
  22              {% if prepend %}
  23                  <span class="input-group-addon">{{ money_pattern|form_encode_currency }}</span>
  24              {% endif %}
  25              {{- block('form_widget_simple') -}}
  26              {% if append %}
  27                  <span class="input-group-addon">{{ money_pattern|form_encode_currency }}</span>
  28              {% endif %}
  29          </div>
  30      {% else %}
  31          {{- block('form_widget_simple') -}}
  32      {% endif %}
  33  {%- endblock money_widget %}
  34  
  35  {% block checkbox_widget -%}
  36      {%- set parent_label_class = parent_label_class|default(label_attr.class|default('')) -%}
  37      {% if 'checkbox-inline' in parent_label_class %}
  38          {{- form_label(form, null, { widget: parent() }) -}}
  39      {% else -%}
  40          <div class="checkbox">
  41              {{- form_label(form, null, { widget: parent() }) -}}
  42          </div>
  43      {%- endif -%}
  44  {%- endblock checkbox_widget %}
  45  
  46  {% block radio_widget -%}
  47      {%- set parent_label_class = parent_label_class|default(label_attr.class|default('')) -%}
  48      {%- if 'radio-inline' in parent_label_class -%}
  49          {{- form_label(form, null, { widget: parent() }) -}}
  50      {%- else -%}
  51          <div class="radio">
  52              {{- form_label(form, null, { widget: parent() }) -}}
  53          </div>
  54      {%- endif -%}
  55  {%- endblock radio_widget %}
  56  
  57  {# Labels #}
  58  
  59  {% block form_label -%}
  60      {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' control-label')|trim}) -%}
  61      {{- parent() -}}
  62  {%- endblock form_label %}
  63  
  64  {% block choice_label -%}
  65      {# remove the checkbox-inline and radio-inline class, it's only useful for embed labels #}
  66      {%- set label_attr = label_attr|merge({class: label_attr.class|default('')|replace({'checkbox-inline': '', 'radio-inline': ''})|trim}) -%}
  67      {{- block('form_label') -}}
  68  {% endblock %}
  69  
  70  {% block checkbox_label -%}
  71      {%- set label_attr = label_attr|merge({'for': id}) -%}
  72  
  73      {{- block('checkbox_radio_label') -}}
  74  {%- endblock checkbox_label %}
  75  
  76  {% block radio_label -%}
  77      {%- set label_attr = label_attr|merge({'for': id}) -%}
  78  
  79      {{- block('checkbox_radio_label') -}}
  80  {%- endblock radio_label %}
  81  
  82  {% block checkbox_radio_label -%}
  83      {# Do not display the label if widget is not defined in order to prevent double label rendering #}
  84      {%- if widget is defined -%}
  85          {%- if required -%}
  86              {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) -%}
  87          {%- endif -%}
  88          {%- if parent_label_class is defined -%}
  89              {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|trim}) -%}
  90          {%- endif -%}
  91          {%- if label is not same as(false) and label is empty -%}
  92              {%- if label_format is not empty -%}
  93                  {%- set label = label_format|replace({
  94                      '%name%': name,
  95                      '%id%': id,
  96                  }) -%}
  97              {%- else -%}
  98                  {% set label = name|humanize %}
  99              {%- endif -%}
 100          {%- endif -%}
 101          <label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
 102              {{- widget|raw }} {{ label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
 103          </label>
 104      {%- endif -%}
 105  {%- endblock checkbox_radio_label %}
 106  
 107  {# Rows #}
 108  
 109  {% block form_row -%}
 110      <div class="form-group{% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %}">
 111          {{- form_label(form) }} {# -#}
 112          {{ form_widget(form) }} {# -#}
 113          {{ form_errors(form) }} {# -#}
 114      </div> {# -#}
 115  {%- endblock form_row %}
 116  
 117  {% block button_row -%}
 118      <div class="form-group">
 119          {{- form_widget(form) -}}
 120      </div>
 121  {%- endblock button_row %}
 122  
 123  {% block choice_row -%}
 124      {% set force_error = true %}
 125      {{- block('form_row') }}
 126  {%- endblock choice_row %}
 127  
 128  {% block date_row -%}
 129      {% set force_error = true %}
 130      {{- block('form_row') }}
 131  {%- endblock date_row %}
 132  
 133  {% block time_row -%}
 134      {% set force_error = true %}
 135      {{- block('form_row') }}
 136  {%- endblock time_row %}
 137  
 138  {% block datetime_row -%}
 139      {% set force_error = true %}
 140      {{- block('form_row') }}
 141  {%- endblock datetime_row %}
 142  
 143  {% block checkbox_row -%}
 144      <div class="form-group{% if not valid %} has-error{% endif %}">
 145          {{- form_widget(form) -}}
 146          {{- form_errors(form) -}}
 147      </div>
 148  {%- endblock checkbox_row %}
 149  
 150  {% block radio_row -%}
 151      <div class="form-group{% if not valid %} has-error{% endif %}">
 152          {{- form_widget(form) -}}
 153          {{- form_errors(form) -}}
 154      </div>
 155  {%- endblock radio_row %}
 156  
 157  {# Errors #}
 158  
 159  {% block form_errors -%}
 160      {% if errors|length > 0 -%}
 161      {% if form is not rootform %}<span class="help-block">{% else %}<div class="alert alert-danger">{% endif %}
 162      <ul class="list-unstyled">
 163          {%- for error in errors -%}
 164              <li><span class="glyphicon glyphicon-exclamation-sign"></span> {{ error.message }}</li>
 165          {%- endfor -%}
 166      </ul>
 167      {% if form is not rootform %}</span>{% else %}</div>{% endif %}
 168      {%- endif %}
 169  {%- endblock form_errors %}


Generated: Sat Nov 4 14:26:03 2023 Cross-referenced by PHPXref 0.7.1