You are here

public static function WebformOptions::hasOptGroup in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Element/WebformOptions.php \Drupal\webform\Element\WebformOptions::hasOptGroup()

Determine if options array contains an OptGroup.

Parameters

array $options: An array of options.

Return value

bool TRUE if options array contains an OptGroup.

2 calls to WebformOptions::hasOptGroup()
WebformOptions::processWebformOptions in src/Element/WebformOptions.php
Process options and build options widget.
WebformOptions::valueCallback in src/Element/WebformOptions.php
Determines how user input is mapped to an element's #value property.

File

src/Element/WebformOptions.php, line 285

Class

WebformOptions
Provides a webform element to assist in creation of options.

Namespace

Drupal\webform\Element

Code

public static function hasOptGroup(array $options) {
  foreach ($options as $option_text) {
    if (is_array($option_text)) {
      return TRUE;
    }
  }
  return FALSE;
}