You are here

public static function WebformLink::getCompositeElements in Webform 6.x

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

Get a renderable array of webform elements.

Parameters

array $element: A render array for the current element.

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/WebformLink.php, line 22

Class

WebformLink
Provides a webform element for a link.

Namespace

Drupal\webform\Element

Code

public static function getCompositeElements(array $element) {
  $elements = [];
  $elements['title'] = [
    '#type' => 'textfield',
    '#title' => t('Link Title'),
    '#maxlength' => 255,
  ];
  $elements['url'] = [
    '#type' => 'url',
    '#title' => t('Link URL'),
  ];
  return $elements;
}