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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -