ArrayExtension
class ArrayExtension extends AbstractExtension (View source)
Bolt specific Twig functions and filters that provide array manipulation.
Methods
array
getFilters()
{@inheritdoc}
shuffle($array)
Randomly shuffle the contents of a passed array.
length(Environment $env, $thing)
Returns the length of a variable.
static array
order(array $array, string $on = '-datepublish', string|null $onSecondary = null)
Sorts / orders items of an array.
Details
array
getFilters()
{@inheritdoc}
shuffle($array)
Randomly shuffle the contents of a passed array.
length(Environment $env, $thing)
Returns the length of a variable.
Overrides the default Twig |length filter for accurate results with paginated content
static array
order(array $array, string $on = '-datepublish', string|null $onSecondary = null)
Sorts / orders items of an array.