public function WebformHandlerDuplicateForm::buildForm in Webform 8.5
Same name and namespace in other branches
- 6.x src/Form/WebformHandlerDuplicateForm.php \Drupal\webform\Form\WebformHandlerDuplicateForm::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.
\Drupal\webform\WebformInterface $webform: The webform.
string $webform_handler: The webform handler ID.
Return value
array The form structure.
Throws
\Symfony\Component\HttpKernel\Exception\NotFoundHttpException Throws not found exception if the number of handler instances for this webform exceeds the handler's cardinality.
Overrides WebformHandlerAddForm::buildForm
File
- src/
Form/ WebformHandlerDuplicateForm.php, line 16
Class
- WebformHandlerDuplicateForm
- Provides a duplicate form for webform handler.
Namespace
Drupal\webform\FormCode
public function buildForm(array $form, FormStateInterface $form_state, WebformInterface $webform = NULL, $webform_handler = NULL) {
$form = parent::buildForm($form, $form_state, $webform, $webform_handler);
$form['#title'] = $this
->t('Duplicate @label handler', [
'@label' => $this->webformHandler
->label(),
]);
return $form;
}