Twig syntaxe : Unexpected token "punctuation" of value "."

Viewed 2766

I'm trying to assign an object to a form property :

{% if form.person is not defined %}
    {%- set form.person = form.fatherContact -%}
{% endif %}

But I'm getting this error :

Unexpected token "punctuation" of value "." ("end of statement block" expected).

What's wrong with my code ? According to the twig documentation, this is how we assign a variable so I don't get it. Maybe it's because the person property does not exist ?

Thx

0 Answers
Related