jadu/twig-array-extension

Provides Twig extensions to retrive or exclude specific keys/value pairs from an array

1.0.0 2023-09-19 09:11 UTC

This package is auto-updated.

Last update: 2024-04-25 10:01:09 UTC


README

Filters to work with arrays prior to markup output, allowing you to exclude known keys, or only return specified keys. The filters are designed to be very permissive and won't throw any warnings or errors if the supplied keys do not exist.

Typically used in conjunction with Pulsar's attribute parser extension.

Exclude from Array

Returns a filtered array with the specified keys removed.

Multiple items can be provided, space separated.

arrayToModify|exclude('itemToExclude')

Only from Array

Returns only the items present in the filter list based on a case insensitive search

Multiple items can be provided, space separated.

arrayToModify|only('itemToInclude')