OptGroup::flattenOptions

public static OptGroup::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.

Parameters

array $array: The form options array to process.

Return value

array An array with all hierarchical elements flattened to a single array.

File

core/lib/Drupal/Core/Form/OptGroup.php, line 23

Class

OptGroup
Provides helpers for HTML option groups.

Namespace

Drupal\Core\Form

Code

public static function flattenOptions(array $array) {
  $options = array();
  static::doFlattenOptions($array, $options);
  return $options;
}
doc_Drupal
2016-10-29 09:32:34
Comments
Leave a Comment

Please login to continue.