public function WebformEntitySettingsConfirmationForm::buildForm in Webform 8.5
Same name and namespace in other branches
- 6.x src/EntitySettings/WebformEntitySettingsConfirmationForm.php \Drupal\webform\EntitySettings\WebformEntitySettingsConfirmationForm::buildForm()
Form constructor.
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 The form structure.
Overrides EntityForm::buildForm
File
- src/
EntitySettings/ WebformEntitySettingsConfirmationForm.php, line 45
Class
- WebformEntitySettingsConfirmationForm
- Webform confirmation settings.
Namespace
Drupal\webform\EntitySettingsCode
public function buildForm(array $form, FormStateInterface $form_state) {
/** @var \Drupal\webform\WebformInterface $webform */
$webform = $this->entity;
$elements = $webform
->getElementsDecoded();
if (!empty($elements['#method'])) {
$this
->messenger()
->addWarning($this
->t('Form is being posted using a custom method. Confirmation page must be handled by the <a href=":href">custom form action</a>.', [
':href' => $webform
->toUrl('settings-form')
->toString(),
]));
return $form;
}
return parent::buildForm($form, $form_state);
}