We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Variable Scope in Volt

Hello guys, i'm having annoying problem with volt partials.

I have a partial volt to reuse in my view like this:

{{ partial('front/elements/cupom', ['cupons': cupons, 'newsletter': true]) }}

{% if cuponsExpirados is not empty %}
       <h3 class="text"> Cupons Expirados </h3>

       {{ partial('front/elements/cupom', ['cupons': cuponsExpirados]) }}
{% endif %}

As you can see im sending "newsletter: true" to first partial, but the second partial is having this assigned in their scope.

How can i avoid that problem? I dont need the "newsletter" var assigned in second partial.

Volt cant handle with scope like twig or blade? Everything assigned will be global?