PHP Class Bolt\Twig\Handler\ArrayHandler

Show file Open project: bolt/bolt Class Usage Examples

Public Methods

Method Description
__construct ( Silex\Application $app )
order ( array $array, string $on, string $onSecondary = '' ) : array Sorts / orders items of an array.
shuffle ( array $array ) : array Randomly shuffle the contents of a passed array.
unique ( $arr1, $arr2 ) : array Takes two arrays and returns a compiled array of unique, sorted values

Private Methods

Method Description
orderHelper ( Content | array $a, Content | array $b ) : boolean Helper function for sorting an array of \Bolt\Legacy\Content.

Method Details

__construct() public method

public __construct ( Silex\Application $app )
$app Silex\Application

order() public method

Sorts / orders items of an array.
public order ( array $array, string $on, string $onSecondary = '' ) : array
$array array
$on string
$onSecondary string
return array

shuffle() public method

Randomly shuffle the contents of a passed array.
public shuffle ( array $array ) : array
$array array
return array

unique() public method

Takes two arrays and returns a compiled array of unique, sorted values
public unique ( $arr1, $arr2 ) : array
$arr1
$arr2
return array