You are here

public function BanDelete::buildForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/ban/src/Form/BanDelete.php \Drupal\ban\Form\BanDelete::buildForm()
  2. 9 core/modules/ban/src/Form/BanDelete.php \Drupal\ban\Form\BanDelete::buildForm()

Parameters

array $form: A nested array form elements comprising the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

string $ban_id: The IP address record ID to unban.

Overrides ConfirmFormBase::buildForm

File

core/modules/ban/src/Form/BanDelete.php, line 90

Class

BanDelete
Provides a form to unban IP addresses.

Namespace

Drupal\ban\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $ban_id = '') {
  if (!($this->banIp = $this->ipManager
    ->findById($ban_id))) {
    throw new NotFoundHttpException();
  }
  return parent::buildForm($form, $form_state);
}