You are here

public static function YamlFormContact::getCompositeElements in YAML Form 8

Same name in this branch
  1. 8 src/Element/YamlFormContact.php \Drupal\yamlform\Element\YamlFormContact::getCompositeElements()
  2. 8 src/Plugin/YamlFormElement/YamlFormContact.php \Drupal\yamlform\Plugin\YamlFormElement\YamlFormContact::getCompositeElements()

Get a renderable array of form elements.

Return value

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

Overrides YamlFormAddress::getCompositeElements

1 call to YamlFormContact::getCompositeElements()
YamlFormContact::getCompositeElements in src/Plugin/YamlFormElement/YamlFormContact.php
Get composite elements.

File

src/Element/YamlFormContact.php, line 15

Class

YamlFormContact
Provides a form element for a contact element.

Namespace

Drupal\yamlform\Element

Code

public static function getCompositeElements() {
  $elements = [];
  $elements['name'] = [
    '#type' => 'textfield',
    '#title' => t('Name'),
  ];
  $elements['company'] = [
    '#type' => 'textfield',
    '#title' => t('Company'),
  ];
  $elements['email'] = [
    '#type' => 'email',
    '#title' => t('Email'),
  ];
  $elements['phone'] = [
    '#type' => 'tel',
    '#title' => t('Phone'),
  ];
  $elements += parent::getCompositeElements();
  return $elements;
}