You are here

public static function WebformComposite::getCompositeElements in Webform Composite Tools 8

Same name in this branch
  1. 8 src/Element/WebformComposite.php \Drupal\webform_composite\Element\WebformComposite::getCompositeElements()
  2. 8 src/Plugin/WebformElement/WebformComposite.php \Drupal\webform_composite\Plugin\WebformElement\WebformComposite::getCompositeElements()

Get a renderable array of webform elements.

Return value

array A renderable array of webform elements, containing the base properties for the composite's webform elements.

Overrides WebformCompositeBase::getCompositeElements

File

src/Element/WebformComposite.php, line 25

Class

WebformComposite
Provides an composite webform element.

Namespace

Drupal\webform_composite\Element

Code

public static function getCompositeElements(array $element) {
  $element_manager = \Drupal::service('plugin.manager.webform.element');
  if ($element["#type"] === "webform_composite") {
    $element["#type"] = $element["#webform_composite"];
  }
  $instance = $element_manager
    ->getElementInstance($element);
  $sub_elem = $instance
    ->getCompositeElements();
  return $sub_elem;
}