list_filter
Filters an array by a lookup value.
Example
1
2
3
4
| {{ $source | list_filter: 'attribute', 'lookupValue', 'contains', 'negate' }} => [
'key1' => 'value1',
'key2' => 'value2'
]
|
Type |
Parameter |
Description |
Required |
array |
source |
The array to filter. Comes before the | sign. |
Required |
string |
attribute |
The attribute to filter by |
|
mixed |
lookupValue |
The value to filter for |
|
bool |
contains |
Whether to filter by a substring, defaults to false |
|
bool |
negate |
Whether to negate the filter, defaults to false |
|
Output
Type |
Description |
array |
The filtered array |