templates/components/Form/Input/index.html.twig line 1

Open in your IDE?
  1. {% extends 'components/Form/Layout/index.html.twig' %}
  2. {% set required = required ?? true %}
  3. {% set type = type ?? 'text' %}
  4. {% set inputClassName = inputClassName ?? '' %}
  5. {% set placeholder = placeholder ?? '' %}
  6. {% set icon = icon ?? false %}
  7. {% set name = name ?? false %}
  8. {% set disabled = disabled ?? false %}
  9. {% set value = value ?? false %}
  10. {% set extraAttr = extraAttr ?? false %}
  11. {% block field %}
  12.     {% if icon %}
  13.         <div class="is-relative input-with-icon">
  14.     {% endif %}
  15.     <input
  16.         type="{{ type }}"
  17.         id="{{ id }}"
  18.         name="{{ name }}"
  19.         placeholder="{{ placeholder }}"
  20.         {% if required %}
  21.         required
  22.         {% endif %}
  23.         {% if disabled %}
  24.         disabled="disabled"
  25.         {% endif %}
  26.         {% if value %}value="{{ value }}"{% endif %}
  27.         class="input {{ inputClassName }}"
  28.         {% if extraAttr %}{{ extraAttr|raw }}{% endif %}
  29.         />
  30.     {% if icon %}
  31.         <i class="{{ icon }}"></i>
  32.         </div>
  33.     {% endif %}
  34. {% endblock %}