Twig Create New Array

[Solved] Twig Create New Array | Php - Code Explorer | yomemimo.com
Question : twig create new array

Answered by : akbarali

{% set array = [] %}
{% for item in items %} {% set array = array|merge([{ title: item.title, ... }]) %}
{% endfor %}

Source : https://stackoverflow.com/questions/43094837/create-an-array-with-twig/43095117 | Last Update : Thu, 11 Nov 21

Question : twig in array

Answered by : fabian-flores

{{ if myValue in myArray ? 'true' : 'false' }}
{% if myValue in myArray %} // true
{% endif %}

Source : | Last Update : Sat, 11 Sep 21

Answers related to twig create new array

Code Explorer Popular Question For Php