You are here

public function ImageEffectDeleteForm::submitForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/image/src/Form/ImageEffectDeleteForm.php \Drupal\image\Form\ImageEffectDeleteForm::submitForm()
  2. 9 core/modules/image/src/Form/ImageEffectDeleteForm.php \Drupal\image\Form\ImageEffectDeleteForm::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

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

Overrides FormInterface::submitForm

File

core/modules/image/src/Form/ImageEffectDeleteForm.php, line 71

Class

ImageEffectDeleteForm
Form for deleting an image effect.

Namespace

Drupal\image\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->imageStyle
    ->deleteImageEffect($this->imageEffect);
  $this
    ->messenger()
    ->addStatus($this
    ->t('The image effect %name has been deleted.', [
    '%name' => $this->imageEffect
      ->label(),
  ]));
  $form_state
    ->setRedirectUrl($this->imageStyle
    ->toUrl('edit-form'));
}