You are here

public function ImageStyleFlushForm::submitForm in Drupal 10

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

File

core/modules/image/src/Form/ImageStyleFlushForm.php, line 46

Class

ImageStyleFlushForm
Form controller for image style flush.

Namespace

Drupal\image\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->entity
    ->flush();
  $this
    ->messenger()
    ->addStatus($this
    ->t('The image style %name has been flushed.', [
    '%name' => $this->entity
      ->label(),
  ]));
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}