Class

Symfony\Component\Form\Extension\Core\ChoiceList\PaddedChoiceList

class PaddedChoiceList extends ArrayChoiceList

Methods

__construct(array|Closure $values, integer $padLength, string $padString, integer $padType = STR_PAD_LEFT)

Generates an array of choices for the given values

array getChoices()

Returns a list of choices

from ArrayChoiceList

Details

at line 35
public __construct(array|Closure $values, integer $padLength, string $padString, integer $padType = STR_PAD_LEFT)

Generates an array of choices for the given values

If the values are shorter than $padLength characters, they are padded with zeros on the left side.

Parameters

array|Closure $values The available choices
integer $padLength The length to pad the choices
string $padString The padding character
integer $padType The direction of padding

Exceptions

UnexpectedTypeException if the type of the values parameter is not supported

in ArrayChoiceList at line 43
public array getChoices()

Returns a list of choices

Return Value

array