Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

form_div_layout.html.twig

Zuletzt modifiziert: 09.10.2024, 12:58 - Dateigröße: 13.21 KiB


 001  {# Widgets #}
 002   
 003  {%- block form_widget -%}
 004      {% if compound %}
 005          {{- block('form_widget_compound') -}}
 006      {% else %}
 007          {{- block('form_widget_simple') -}}
 008      {% endif %}
 009  {%- endblock form_widget -%}
 010   
 011  {%- block form_widget_simple -%}
 012      {%- set type = type|default('text') -%}
 013      <input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
 014  {%- endblock form_widget_simple -%}
 015   
 016  {%- block form_widget_compound -%}
 017      <div {{ block('widget_container_attributes') }}>
 018          {%- if form.parent is empty -%}
 019              {{ form_errors(form) }}
 020          {%- endif -%}
 021          {{- block('form_rows') -}}
 022          {{- form_rest(form) -}}
 023      </div>
 024  {%- endblock form_widget_compound -%}
 025   
 026  {%- block collection_widget -%}
 027      {% if prototype is defined %}
 028          {%- set attr = attr|merge({'data-prototype': form_row(prototype) }) -%}
 029      {% endif %}
 030      {{- block('form_widget') -}}
 031  {%- endblock collection_widget -%}
 032   
 033  {%- block textarea_widget -%}
 034      <textarea {{ block('widget_attributes') }}>{{ value }}</textarea>
 035  {%- endblock textarea_widget -%}
 036   
 037  {%- block choice_widget -%}
 038      {% if expanded %}
 039          {{- block('choice_widget_expanded') -}}
 040      {% else %}
 041          {{- block('choice_widget_collapsed') -}}
 042      {% endif %}
 043  {%- endblock choice_widget -%}
 044   
 045  {%- block choice_widget_expanded -%}
 046      <div {{ block('widget_container_attributes') }}>
 047      {%- for child in form %}
 048          {{- form_widget(child) -}}
 049          {{- form_label(child, null, {translation_domain: choice_translation_domain}) -}}
 050      {% endfor -%}
 051      </div>
 052  {%- endblock choice_widget_expanded -%}
 053   
 054  {%- block choice_widget_collapsed -%}
 055      {%- if required and placeholder is none and not placeholder_in_choices and not multiple and (attr.size is not defined or attr.size <= 1) -%}
 056          {% set required = false %}
 057      {%- endif -%}
 058      <select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
 059          {%- if placeholder is not none -%}
 060              <option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ placeholder != '' ? (translation_domain is same as(false) ? placeholder : placeholder|trans({}, translation_domain)) }}</option>
 061          {%- endif -%}
 062          {%- if preferred_choices|length > 0 -%}
 063              {% set options = preferred_choices %}
 064              {{- block('choice_widget_options') -}}
 065              {%- if choices|length > 0 and separator is not none -%}
 066                  <option disabled="disabled">{{ separator }}</option>
 067              {%- endif -%}
 068          {%- endif -%}
 069          {%- set options = choices -%}
 070          {{- block('choice_widget_options') -}}
 071      </select>
 072  {%- endblock choice_widget_collapsed -%}
 073   
 074  {%- block choice_widget_options -%}
 075      {% for group_label, choice in options %}
 076          {%- if choice is iterable -%}
 077              <optgroup label="{{ choice_translation_domain is same as(false) ? group_label : group_label|trans({}, choice_translation_domain) }}">
 078                  {% set options = choice %}
 079                  {{- block('choice_widget_options') -}}
 080              </optgroup>
 081          {%- else -%}
 082              <option value="{{ choice.value }}"{% if choice.attr %} {% set attr = choice.attr %}{{ block('attributes') }}{% endif %}{% if choice is selectedchoice(value) %} selected="selected"{% endif %}>{{ choice_translation_domain is same as(false) ? choice.label : choice.label|trans({}, choice_translation_domain) }}</option>
 083          {%- endif -%}
 084      {% endfor %}
 085  {%- endblock choice_widget_options -%}
 086   
 087  {%- block checkbox_widget -%}
 088      <input type="checkbox" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} />
 089  {%- endblock checkbox_widget -%}
 090   
 091  {%- block radio_widget -%}
 092      <input type="radio" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} />
 093  {%- endblock radio_widget -%}
 094   
 095  {%- block datetime_widget -%}
 096      {% if widget == 'single_text' %}
 097          {{- block('form_widget_simple') -}}
 098      {%- else -%}
 099          <div {{ block('widget_container_attributes') }}>
 100              {{- form_errors(form.date) -}}
 101              {{- form_errors(form.time) -}}
 102              {{- form_widget(form.date) -}}
 103              {{- form_widget(form.time) -}}
 104          </div>
 105      {%- endif -%}
 106  {%- endblock datetime_widget -%}
 107   
 108  {%- block date_widget -%}
 109      {%- if widget == 'single_text' -%}
 110          {{ block('form_widget_simple') }}
 111      {%- else -%}
 112          <div {{ block('widget_container_attributes') }}>
 113              {{- date_pattern|replace({
 114                  '{{ year }}':  form_widget(form.year),
 115                  '{{ month }}': form_widget(form.month),
 116                  '{{ day }}':   form_widget(form.day),
 117              })|raw -}}
 118          </div>
 119      {%- endif -%}
 120  {%- endblock date_widget -%}
 121   
 122  {%- block time_widget -%}
 123      {%- if widget == 'single_text' -%}
 124          {{ block('form_widget_simple') }}
 125      {%- else -%}
 126          {%- set vars = widget == 'text' ? { 'attr': { 'size': 1 }} : {} -%}
 127          <div {{ block('widget_container_attributes') }}>
 128              {{ form_widget(form.hour, vars) }}{% if with_minutes %}:{{ form_widget(form.minute, vars) }}{% endif %}{% if with_seconds %}:{{ form_widget(form.second, vars) }}{% endif %}
 129          </div>
 130      {%- endif -%}
 131  {%- endblock time_widget -%}
 132   
 133  {%- block number_widget -%}
 134      {# type="number" doesn't work with floats #}
 135      {%- set type = type|default('text') -%}
 136      {{ block('form_widget_simple') }}
 137  {%- endblock number_widget -%}
 138   
 139  {%- block integer_widget -%}
 140      {%- set type = type|default('number') -%}
 141      {{ block('form_widget_simple') }}
 142  {%- endblock integer_widget -%}
 143   
 144  {%- block money_widget -%}
 145      {{ money_pattern|replace({ '{{ widget }}': block('form_widget_simple') })|raw }}
 146  {%- endblock money_widget -%}
 147   
 148  {%- block url_widget -%}
 149      {%- set type = type|default('url') -%}
 150      {{ block('form_widget_simple') }}
 151  {%- endblock url_widget -%}
 152   
 153  {%- block search_widget -%}
 154      {%- set type = type|default('search') -%}
 155      {{ block('form_widget_simple') }}
 156  {%- endblock search_widget -%}
 157   
 158  {%- block percent_widget -%}
 159      {%- set type = type|default('text') -%}
 160      {{ block('form_widget_simple') }} %
 161  {%- endblock percent_widget -%}
 162   
 163  {%- block password_widget -%}
 164      {%- set type = type|default('password') -%}
 165      {{ block('form_widget_simple') }}
 166  {%- endblock password_widget -%}
 167   
 168  {%- block hidden_widget -%}
 169      {%- set type = type|default('hidden') -%}
 170      {{ block('form_widget_simple') }}
 171  {%- endblock hidden_widget -%}
 172   
 173  {%- block email_widget -%}
 174      {%- set type = type|default('email') -%}
 175      {{ block('form_widget_simple') }}
 176  {%- endblock email_widget -%}
 177   
 178  {%- block range_widget -%}
 179      {% set type = type|default('range') %}
 180      {{- block('form_widget_simple') -}}
 181  {%- endblock range_widget %}
 182   
 183  {%- block button_widget -%}
 184      {%- if label is empty -%}
 185          {%- if label_format is not empty -%}
 186              {% set label = label_format|replace({
 187                  '%name%': name,
 188                  '%id%': id,
 189              }) %}
 190          {%- else -%}
 191              {% set label = name|humanize %}
 192          {%- endif -%}
 193      {%- endif -%}
 194      <button type="{{ type|default('button') }}" {{ block('button_attributes') }}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}</button>
 195  {%- endblock button_widget -%}
 196   
 197  {%- block submit_widget -%}
 198      {%- set type = type|default('submit') -%}
 199      {{ block('button_widget') }}
 200  {%- endblock submit_widget -%}
 201   
 202  {%- block reset_widget -%}
 203      {%- set type = type|default('reset') -%}
 204      {{ block('button_widget') }}
 205  {%- endblock reset_widget -%}
 206   
 207  {# Labels #}
 208   
 209  {%- block form_label -%}
 210      {% if label is not same as(false) -%}
 211          {% if not compound -%}
 212              {% set label_attr = label_attr|merge({'for': id}) %}
 213          {%- endif -%}
 214          {% if required -%}
 215              {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %}
 216          {%- endif -%}
 217          {% if label is empty -%}
 218              {%- if label_format is not empty -%}
 219                  {% set label = label_format|replace({
 220                      '%name%': name,
 221                      '%id%': id,
 222                  }) %}
 223              {%- else -%}
 224                  {% set label = name|humanize %}
 225              {%- endif -%}
 226          {%- endif -%}
 227          <label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}</label>
 228      {%- endif -%}
 229  {%- endblock form_label -%}
 230   
 231  {%- block button_label -%}{%- endblock -%}
 232   
 233  {# Rows #}
 234   
 235  {%- block repeated_row -%}
 236      {#
 237      No need to render the errors here, as all errors are mapped
 238      to the first child (see RepeatedTypeValidatorExtension).
 239      #}
 240      {{- block('form_rows') -}}
 241  {%- endblock repeated_row -%}
 242   
 243  {%- block form_row -%}
 244      <div>
 245          {{- form_label(form) -}}
 246          {{- form_errors(form) -}}
 247          {{- form_widget(form) -}}
 248      </div>
 249  {%- endblock form_row -%}
 250   
 251  {%- block button_row -%}
 252      <div>
 253          {{- form_widget(form) -}}
 254      </div>
 255  {%- endblock button_row -%}
 256   
 257  {%- block hidden_row -%}
 258      {{ form_widget(form) }}
 259  {%- endblock hidden_row -%}
 260   
 261  {# Misc #}
 262   
 263  {%- block form -%}
 264      {{ form_start(form) }}
 265          {{- form_widget(form) -}}
 266      {{ form_end(form) }}
 267  {%- endblock form -%}
 268   
 269  {%- block form_start -%}
 270      {% set method = method|upper %}
 271      {%- if method in ["GET", "POST"] -%}
 272          {% set form_method = method %}
 273      {%- else -%}
 274          {% set form_method = "POST" %}
 275      {%- endif -%}
 276      <form name="{{ name }}" method="{{ form_method|lower }}"{% if action != '' %} action="{{ action }}"{% endif %}{% for attrname, attrvalue in attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}{% if multipart %} enctype="multipart/form-data"{% endif %}>
 277      {%- if form_method != method -%}
 278          <input type="hidden" name="_method" value="{{ method }}" />
 279      {%- endif -%}
 280  {%- endblock form_start -%}
 281   
 282  {%- block form_end -%}
 283      {%- if not render_rest is defined or render_rest -%}
 284          {{ form_rest(form) }}
 285      {%- endif -%}
 286      </form>
 287  {%- endblock form_end -%}
 288   
 289  {%- block form_enctype -%}
 290      {% if multipart %}enctype="multipart/form-data"{% endif %}
 291  {%- endblock form_enctype -%}
 292   
 293  {%- block form_errors -%}
 294      {%- if errors|length > 0 -%}
 295      <ul>
 296          {%- for error in errors -%}
 297              <li>{{ error.message }}</li>
 298          {%- endfor -%}
 299      </ul>
 300      {%- endif -%}
 301  {%- endblock form_errors -%}
 302   
 303  {%- block form_rest -%}
 304      {% for child in form -%}
 305          {% if not child.rendered %}
 306              {{- form_row(child) -}}
 307          {% endif %}
 308      {%- endfor %}
 309  {% endblock form_rest %}
 310   
 311  {# Support #}
 312   
 313  {%- block form_rows -%}
 314      {% for child in form %}
 315          {{- form_row(child) -}}
 316      {% endfor %}
 317  {%- endblock form_rows -%}
 318   
 319  {%- block widget_attributes -%}
 320      id="{{ id }}" name="{{ full_name }}"
 321      {%- if read_only %} readonly="readonly"{% endif -%}
 322      {%- if disabled %} disabled="disabled"{% endif -%}
 323      {%- if required %} required="required"{% endif -%}
 324      {%- for attrname, attrvalue in attr if 'readonly' != attrname or not read_only -%}
 325          {{- " " -}}
 326          {%- if attrname in ['placeholder', 'title'] -%}
 327              {{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"
 328          {%- elseif attrvalue is same as(true) -%}
 329              {{- attrname }}="{{ attrname }}"
 330          {%- elseif attrvalue is not same as(false) -%}
 331              {{- attrname }}="{{ attrvalue }}"
 332          {%- endif -%}
 333      {%- endfor -%}
 334  {%- endblock widget_attributes -%}
 335   
 336  {%- block widget_container_attributes -%}
 337      {%- if id is not empty %}id="{{ id }}"{% endif -%}
 338      {%- for attrname, attrvalue in attr -%}
 339          {{- " " -}}
 340          {%- if attrname in ['placeholder', 'title'] -%}
 341              {{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"
 342          {%- elseif attrvalue is same as(true) -%}
 343              {{- attrname }}="{{ attrname }}"
 344          {%- elseif attrvalue is not same as(false) -%}
 345              {{- attrname }}="{{ attrvalue }}"
 346          {%- endif -%}
 347      {%- endfor -%}
 348  {%- endblock widget_container_attributes -%}
 349   
 350  {%- block button_attributes -%}
 351      id="{{ id }}" name="{{ full_name }}"{% if disabled %} disabled="disabled"{% endif -%}
 352      {%- for attrname, attrvalue in attr -%}
 353          {{- " " -}}
 354          {%- if attrname in ['placeholder', 'title'] -%}
 355              {{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"
 356          {%- elseif attrvalue is same as(true) -%}
 357              {{- attrname }}="{{ attrname }}"
 358          {%- elseif attrvalue is not same as(false) -%}
 359              {{- attrname }}="{{ attrvalue }}"
 360          {%- endif -%}
 361      {%- endfor -%}
 362  {%- endblock button_attributes -%}
 363   
 364  {% block attributes -%}
 365      {%- for attrname, attrvalue in attr -%}
 366          {{- " " -}}
 367          {%- if attrname in ['placeholder', 'title'] -%}
 368              {{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"
 369          {%- elseif attrvalue is same as(true) -%}
 370              {{- attrname }}="{{ attrname }}"
 371          {%- elseif attrvalue is not same as(false) -%}
 372              {{- attrname }}="{{ attrvalue }}"
 373          {%- endif -%}
 374      {%- endfor -%}
 375  {%- endblock attributes -%}
 376