You are here

public function PurgerFormController::deleteForm in Purge 8.3

Render the purger delete form.

Parameters

string $id: Unique instance ID for the purger instance.

Return value

array The render array.

1 string reference to 'PurgerFormController::deleteForm'
purge_ui.routing.yml in modules/purge_ui/purge_ui.routing.yml
modules/purge_ui/purge_ui.routing.yml

File

modules/purge_ui/src/Controller/PurgerFormController.php, line 123

Class

PurgerFormController
Controller for purger configuration forms.

Namespace

Drupal\purge_ui\Controller

Code

public function deleteForm($id) {

  // Although it might look like a logic bug that we aren't checking whether
  // the ID exists and always return the form, this is a must. Else submitting
  // the form never works as the purger has been deleted before.
  if (!($definition = $this
    ->getPurgerPluginDefinition($id))) {
    $definition = [
      'label' => '',
    ];
  }
  return $this
    ->formBuilder()
    ->getForm("\\Drupal\\purge_ui\\Form\\PurgerDeleteForm", [
    'id' => $id,
    'definition' => $definition,
  ]);
}