custom/plugins/SwagCmsExtensions/src/Resources/views/storefront/element/custom-form/form-components/form-component-number.html.twig line 1

Open in your IDE?
  1. {% block swag_cms_extensions_form_component_number %}
  2.     <div class="form-group col-md-{{ field.width }}">
  3.         {% block swag_cms_extensions_form_component_number_label %}
  4.             <label class="form-label" for="form-{{ form.technicalName }}-{{ field.technicalName }}">
  5.                 {{- field.translated.label -}}{% if field.required %} {{- "general.required"|trans -}}{% endif %}
  6.             </label>
  7.         {% endblock %}
  8.         {% block swag_cms_extensions_form_component_number_input %}
  9.             <input name="{{ field.technicalName }}"
  10.                    type="number"
  11.                    id="form-{{ form.technicalName }}-{{ field.technicalName }}"
  12.                    class="form-control{% if formViolations.getViolations( '/' ~ field.technicalName ) %} is-invalid{% endif %}"
  13.                    value="{{ data.get( field.technicalName ) }}"
  14.                    placeholder="{{ field.translated.placeholder }}"
  15.                    {% if field.required %}required="required"{% endif %}
  16.                    {% if field.translated.config.min %}min="{{ field.translated.config.min }}"{% endif %}
  17.                    {% if field.translated.config.max %}max="{{ field.translated.config.max }}"{% endif %}
  18.                    {% if field.translated.config.step %}step="{{ field.translated.config.step }}"{% endif %}
  19.                    {% if field.translated.errorMessage %}data-form-validation-error-message="{{ field.translated.errorMessage }}"{% endif %}/>
  20.             {% if formViolations.getViolations( '/' ~ field.technicalName ) is not empty %}
  21.                 {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' with {
  22.                     violationPath: ('/' ~ field.technicalName)
  23.                 } %}
  24.             {% endif %}
  25.         {% endblock %}
  26.     </div>
  27. {% endblock %}