You are here

public static function WebformBootstrapRenderCallbacks::webformLikertPreRender in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_bootstrap/src/WebformBootstrapRenderCallbacks.php \Drupal\webform_bootstrap\WebformBootstrapRenderCallbacks::webformLikertPreRender()

Render callback for the likerts element.

Parameters

array $element: The render array.

Return value

array The altered render array.

File

modules/webform_bootstrap/src/WebformBootstrapRenderCallbacks.php, line 22

Class

WebformBootstrapRenderCallbacks
Render callbacks for the webform bootstrap module.

Namespace

Drupal\webform_bootstrap

Code

public static function webformLikertPreRender(array $element) {
  foreach (Element::children($element) as $element_key) {

    // Likerts allow description display to be configured, so disable
    // smart description.
    if (!empty($element[$element_key]['#description'])) {
      $element[$element_key]['#smart_description'] = FALSE;
    }
    $element[$element_key] = static::webformLikertPreRender($element[$element_key]);
  }
  return $element;
}