column
Новое в версии 2.8: Фильтр column был добавлен в Twig 2.8.
Фильтр 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/2.x/filters/column.html