You are here

class WebformBootstrapRenderCallbacks in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_bootstrap/src/WebformBootstrapRenderCallbacks.php \Drupal\webform_bootstrap\WebformBootstrapRenderCallbacks

Render callbacks for the webform bootstrap module.

Hierarchy

Expanded class hierarchy of WebformBootstrapRenderCallbacks

1 file declares its use of WebformBootstrapRenderCallbacks
webform_bootstrap.module in modules/webform_bootstrap/webform_bootstrap.module
Helps support Webform to Bootstrap integration.

File

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

Namespace

Drupal\webform_bootstrap
View source
class WebformBootstrapRenderCallbacks implements RenderCallbackInterface {

  /**
   * Render callback for the likerts element.
   *
   * @param array $element
   *   The render array.
   *
   * @return array
   *   The altered render array.
   */
  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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
WebformBootstrapRenderCallbacks::webformLikertPreRender public static function Render callback for the likerts element.