class ImageStyleFlushForm
Same name and namespace in other branches
- 11.x core/modules/image/src/Form/ImageStyleFlushForm.php \Drupal\image\Form\ImageStyleFlushForm
- 10 core/modules/image/src/Form/ImageStyleFlushForm.php \Drupal\image\Form\ImageStyleFlushForm
- 8.9.x core/modules/image/src/Form/ImageStyleFlushForm.php \Drupal\image\Form\ImageStyleFlushForm
Form controller for image style flush.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase implements \Drupal\Core\Form\FormInterface, \Drupal\Core\DependencyInjection\ContainerInjectionInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Logger\LoggerChannelTrait, \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait
- class \Drupal\Core\Entity\EntityForm implements \Drupal\Core\Entity\EntityFormInterface extends \Drupal\Core\Form\FormBase
- class \Drupal\Core\Entity\EntityConfirmFormBase implements \Drupal\Core\Form\ConfirmFormInterface extends \Drupal\Core\Entity\EntityForm
- class \Drupal\image\Form\ImageStyleFlushForm extends \Drupal\Core\Entity\EntityConfirmFormBase
- class \Drupal\Core\Entity\EntityConfirmFormBase implements \Drupal\Core\Form\ConfirmFormInterface extends \Drupal\Core\Entity\EntityForm
- class \Drupal\Core\Entity\EntityForm implements \Drupal\Core\Entity\EntityFormInterface extends \Drupal\Core\Form\FormBase
Expanded class hierarchy of ImageStyleFlushForm
File
-
core/
modules/ image/ src/ Form/ ImageStyleFlushForm.php, line 13
Namespace
Drupal\image\FormView source
class ImageStyleFlushForm extends EntityConfirmFormBase {
/**
* {@inheritdoc}
*/
public function getQuestion() {
return $this->t('Are you sure you want to apply the updated %name image effect to all images?', [
'%name' => $this->entity
->label(),
]);
}
/**
* {@inheritdoc}
*/
public function getDescription() {
return $this->t('This operation does not change the original images but the copies created for this style will be recreated.');
}
/**
* {@inheritdoc}
*/
public function getConfirmText() {
return $this->t('Flush');
}
/**
* {@inheritdoc}
*/
public function getCancelUrl() {
return $this->entity
->toUrl('collection');
}
/**
* {@inheritdoc}
*/
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());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.