function ImageEffectDeleteForm::submitForm

Same name in other branches
  1. 9 core/modules/image/src/Form/ImageEffectDeleteForm.php \Drupal\image\Form\ImageEffectDeleteForm::submitForm()
  2. 8.9.x core/modules/image/src/Form/ImageEffectDeleteForm.php \Drupal\image\Form\ImageEffectDeleteForm::submitForm()
  3. 10 core/modules/image/src/Form/ImageEffectDeleteForm.php \Drupal\image\Form\ImageEffectDeleteForm::submitForm()

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'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.