public function LoqatePcaAddress::form in Loqate 2.x
Gets the actual configuration webform array to be built.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array An associative array contain the element's configuration webform without any default values.
Overrides WebformCompositeBase::form
File
- src/
Plugin/ WebformElement/ LoqatePcaAddress.php, line 96
Class
- LoqatePcaAddress
- Provides a 'PCA address' element.
Namespace
Drupal\loqate\Plugin\WebformElementCode
public function form(array $form, FormStateInterface $form_state) {
$form = parent::form($form, $form_state);
$form['pca_address'] = [
'#type' => 'details',
'#title' => $this
->t('PCA address'),
'#open' => TRUE,
];
$form['pca_address']['show_address_fields'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Show address fields'),
];
$form['pca_address']['allow_manual_input'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Allow manual input'),
];
$form['pca_address']['loqate_api_key'] = [
'#type' => 'key_select',
'#title' => $this
->t('Loqate API key'),
];
return $form;
}