This repository has been archived on 2025-09-29. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
drupalcampbristol/web/modules/contrib/webform/src/Element/WebformContact.php
2017-03-16 15:29:07 +00:00

37 lines
735 B
PHP

<?php
namespace Drupal\webform\Element;
/**
* Provides a webform element for a contact element.
*
* @FormElement("webform_contact")
*/
class WebformContact extends WebformAddress {
/**
* {@inheritdoc}
*/
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;
}
}