The Array Extension

The Array extensions provides the following filters:

  • shuffle

Installation

First, install the Extensions library. Next, add the extension to Twig:

$twig->addExtension(new Twig_Extensions_Extension_Array());