You are here

public function WebformConfigEntityDeleteFormBase::getConfirmInput in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Form/WebformConfigEntityDeleteFormBase.php \Drupal\webform\Form\WebformConfigEntityDeleteFormBase::getConfirmInput()

Returns confirm input to display.

Return value

array A renderable array containing confirm input.

Overrides WebformDeleteFormInterface::getConfirmInput

1 call to WebformConfigEntityDeleteFormBase::getConfirmInput()
WebformConfigEntityDeleteFormBase::buildForm in src/Form/WebformConfigEntityDeleteFormBase.php
Form constructor.

File

src/Form/WebformConfigEntityDeleteFormBase.php, line 88

Class

WebformConfigEntityDeleteFormBase
Provides a generic base class for a webform entity deletion form.

Namespace

Drupal\webform\Form

Code

public function getConfirmInput() {
  $t_args = [
    '@entity-type' => $this
      ->getEntity()
      ->getEntityType()
      ->getSingularLabel(),
    '%label' => $this
      ->getEntity()
      ->label(),
  ];
  if ($this->confirmCheckbox) {
    return [
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Yes, I want to delete the %label @entity-type', $t_args),
      '#required' => TRUE,
    ];
  }
  else {
    return [];
  }
}