ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Array.php
Go to the documentation of this file.
1 <?php
2 
16 {
20  public function getFilters()
21  {
22  $filters = array(
23  new Twig_SimpleFilter('shuffle', 'twig_shuffle_filter'),
24  );
25 
26  return $filters;
27  }
28 
32  public function getName()
33  {
34  return 'array';
35  }
36 }
37 
45 function twig_shuffle_filter($array)
46 {
47  if ($array instanceof Traversable) {
48  $array = iterator_to_array($array, false);
49  }
50 
51  shuffle($array);
52 
53  return $array;
54 }
55 
56 class_alias('Twig_Extensions_Extension_Array', 'Twig\Extensions\ArrayExtension', false);
twig_shuffle_filter($array)
Shuffles an array.
Definition: Array.php:45
getName()
{Returns the name of the extension.string The extension namesince 1.26 (to be removed in 2...
Definition: Array.php:32
getFilters()
{Returns a list of filters to add to the existing list.Twig_SimpleFilter[]}
Definition: Array.php:20
Represents a template filter.
Create styles array
The data for the language used.
This file is part of Twig.
Definition: Array.php:15