I want to override form_widget_simple
function
{% block form_widget_simple %}
{% spaceless %}
{% set type = type|default('text') %}
{% if errors|length > 0 %}
{{dump(form.vars.attr)}}
{% endif %}
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
{% endspaceless %}
{% endblock form_widget_simple %}
but I dont know how to set form.vars.attr['class']
inside if
statement
Whent I do set form.vars.attr['class'] = 'error';
I get error Unexpected token "punctuation" of value "." ("end of statement block" expected)