phalcon - How to add a new index to an existing array on Volt? -
so have existing array, want run loop through , recreate new arrays. trying figure out how create own array directly on volt. here code:
{% set onomesagendaamigos = [], onomesagendarecomendado = [], onomesagendaamigosrecomendado = [] %} {% onomeagenda in onomesagenda %} {% set onomesagendastotal = onomeagenda.cliente_nome %} {% if onomeagenda.ind_amigo == 1 %} {% set onomesagendaamigos = onomeagenda %} {% endif %} {% if onomeagenda.ind_recomendado == 1 %} {% set onomesagendarecomendado = onomeagenda.cliente_nome %} {% endif %} {% if onomeagenda.ind_recomendado == 1 , onomeagenda.ind_amigo == 1 %} {% set onomesagendaamigosrecomendado = onomeagenda.cliente_nome %} {% endif %} {% endfor %}
last time have checked there no mechanism setting table bit bit in volt. walk-around use array_merge()
or implement own filter/method volt engine.
anyway it's bit against mvc principles. should set tables need on php part of code.
to loop ever array indexes inside loop use trick:
{% index, value in numbers %} {{ index }}: {{ value }} {% endfor %}
i appreciate part of volt documentation.
Comments
Post a Comment