Edit on GitHub
Jump to docs navigation

Twig Components / Methods / min

min(args) is a Twig function to min returns the lowest value of a sequence, or a set of values:

{{ min(1, 3, 2) }}
{{ min([1, 3, 2]) }}

When called with a mapping, min ignores keys and only compares values:

{{ min({2: "e", 3: "a", 1: "b", 5: "d", 4: "c"}) }}
{# returns "a" #}

Source: Twig



Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.