OptGroup
class OptGroup (View source)
Provides helpers for HTML option groups.
Methods
static array
flattenOptions(array $array)
Allows PHP array processing of multiple select options with the same value.
static
doFlattenOptions(array $array, array $options)
Iterates over an array building a flat array with duplicate keys removed.
Details
static array
flattenOptions(array $array)
Allows PHP array processing of multiple select options with the same value.
Used for form select elements which need to validate HTML option groups and multiple options which may return the same value. Associative PHP arrays cannot handle these structures, since they share a common key.
static protected
doFlattenOptions(array $array, array $options)
Iterates over an array building a flat array with duplicate keys removed.
This function also handles cases where objects are passed as array values.