column
Фильтр column возвращает значения из одного столбца в входном массиве.
{% set items = [{ 'fruit' : 'apple'}, {'fruit' : 'orange' }] %}
{% set fruits = items|column('fruit') %}
{# fruits now contains ['apple', 'orange'] #}
Примечание
Внутренне, Twig использует функцию PHP array_column.
Аргументы
-
name: Имя столбца для извлечения
© 2009–2018 by the Twig Team
Licensed under the three clause BSD license.
The Twig logo is © 2010–2020 Symfony
https://twig.symfony.com/doc/3.x/filters/column.html