templates/Form/Includes/form-control.html.twig line 1

Open in your IDE?
  1. {% set errors = errors | default([]) %}
  2. <div class="form-group {{ (errors | length > 0) ? 'has-error': '' }} {{ styleModifier|default('') }}">
  3.     <div class="{{ inputWrapperModifier|default('') }}">
  4.         {% if label|default(false) %}
  5.             {{ include('Form/Includes/form-control-label.html.twig', _context) }}
  6.         {% endif %}
  7.         <input type="{{ type|default('text') }}"
  8.                class="form-control {{ (errors | length > 0 )? 'is-invalid': '' }} {{ inputModifier|default('') }}"
  9.                name="{{ name }}"
  10.                id="{{ id }}"
  11.                placeholder="{{ placeholder|default('') }}"
  12.                value="{{ value|default('') }}"
  13.         {{ required|default(false) ? 'required' : '' }}
  14.         {{ disabled|default(false) ? 'disabled' : '' }}
  15.         {{ readonly|default(false) ? 'readonly' : '' }}
  16.         {{ helpText | default(null) ? 'aria-describedby="' ~ id ~'-help-block"' : '' }}
  17.         {% for key, value in inputAttributes | default([]) %}
  18.             {{key}}="{{value}}"
  19.         {% endfor %}
  20.         >
  21.     </div>
  22.     {{ include('Form/Includes/form-errors.html.twig', _context) }}
  23.     {{ include('Form/Includes/form-control-help-text.html.twig', _context) }}
  24. </div>