We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Bug If, Elseif, Else in Volt

Today i was working in my sistem when i get a error, but the code seems has no errors

The error happens when i put a for inside another in an conditional if, elseif, else Something like this:

{% if condition is defined %}
    {% for a in app %}
        {% for ac in a.getAppCategory() %}
        {% endfor %}
    {% endfor %}
{% elseif other_condition is defined %}
{% else %}
{% endif %}

Then this show a error appointed to the else line.

Unexpected ENDIF

If i remove the second for the error disappears.

I have searched for this error here in the forum and i found this very similar


Is this a bug right? Or me and this guy are doing something wrong?

Yes this is a bug and has been issued under https://github.com/phalcon/cphalcon/issues/10970