19 lines
1.0 KiB
Twig
19 lines
1.0 KiB
Twig
{% use 'form_div_layout.html.twig' %}
|
|
|
|
{%- block form_widget_simple -%}
|
|
{%- set type = type|default('text') -%}
|
|
{%- if type != 'hidden' -%}
|
|
{%- set attr = attr|merge({'class': (attr.class|default('') ~ ' mt-2 appearance-none text-slate-900 bg-white rounded-md block w-full px-3 h-10 shadow-sm sm:text-sm focus:outline-none placeholder:text-slate-400 focus:ring-2 focus:ring-primary ring-1 ring-slate-200')|trim }) -%}
|
|
{%- if errors|length -%}
|
|
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' ring-red-500 placeholder-red-500 focus:ring-red-500' }) -%}
|
|
{%- endif -%}
|
|
{%- if disabled is defined and disabled == true -%}
|
|
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' cursor-not-allowed' }) -%}
|
|
{%- endif -%}
|
|
{%- endif -%}
|
|
{{ parent() }}
|
|
{%- if disabled is defined and disabled == true -%}
|
|
<input type="hidden" name="{{ form.vars.full_name }}" value="{{ form.vars.value }}">
|
|
{%- endif -%}
|
|
{%- endblock form_widget_simple -%}
|