WebformName.php in Webform 6.x
File
src/Element/WebformName.php
View source
<?php
namespace Drupal\webform\Element;
class WebformName extends WebformCompositeBase {
public function getInfo() {
return parent::getInfo() + [
'#theme' => 'webform_composite_name',
];
}
public static function getCompositeElements(array $element) {
$elements = [];
$elements['title'] = [
'#type' => 'webform_select_other',
'#title' => t('Title'),
'#options' => 'titles',
];
$elements['first'] = [
'#type' => 'textfield',
'#title' => t('First'),
];
$elements['middle'] = [
'#type' => 'textfield',
'#title' => t('Middle'),
];
$elements['last'] = [
'#type' => 'textfield',
'#title' => t('Last'),
];
$elements['suffix'] = [
'#type' => 'textfield',
'#title' => t('Suffix'),
];
$elements['degree'] = [
'#type' => 'textfield',
'#title' => t('Degree'),
];
return $elements;
}
}
Classes
Name |
Description |
WebformName |
Provides a webform element for an name element. |