You are here

public function WebformOptionsCustom::getElement in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_options_custom/src/Entity/WebformOptionsCustom.php \Drupal\webform_options_custom\Entity\WebformOptionsCustom::getElement()

Get the custom options element.

Return value

array The custom options element.

Overrides WebformOptionsCustomInterface::getElement

2 calls to WebformOptionsCustom::getElement()
WebformOptionsCustom::getPreview in modules/webform_options_custom/src/Entity/WebformOptionsCustom.php
Get the custom options element preview.
WebformOptionsCustom::getTemplateOptions in modules/webform_options_custom/src/Entity/WebformOptionsCustom.php
Get template custom options.

File

modules/webform_options_custom/src/Entity/WebformOptionsCustom.php, line 311

Class

WebformOptionsCustom
Defines the webform options custom entity.

Namespace

Drupal\webform_options_custom\Entity

Code

public function getElement() {
  return [
    '#type' => 'webform_options_custom',
    '#options_custom' => $this
      ->id(),
    '#template' => $this
      ->getTemplate(),
    '#options' => $this
      ->getOptions(),
    '#fill' => $this
      ->get('fill'),
    '#zoom' => $this
      ->get('zoom'),
    '#tooltip' => $this
      ->get('tooltip'),
    '#show_select' => $this
      ->get('show_select'),
    '#value_attributes' => $this
      ->get('value_attributes'),
    '#text_attributes' => $this
      ->get('text_attributes'),
  ];
}