ImageEffectEditForm.php
Same filename in other branches
Namespace
Drupal\image\FormFile
-
core/
modules/ image/ src/ Form/ ImageEffectEditForm.php
View source
<?php
namespace Drupal\image\Form;
use Drupal\Core\Form\FormStateInterface;
use Drupal\image\ImageStyleInterface;
/**
* Provides an edit form for image effects.
*
* @internal
*/
class ImageEffectEditForm extends ImageEffectFormBase {
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, ?ImageStyleInterface $image_style = NULL, $image_effect = NULL) {
$form = parent::buildForm($form, $form_state, $image_style, $image_effect);
$form['#title'] = $this->t('Edit %label effect on style %style', [
'%label' => $this->imageEffect
->label(),
'%style' => $image_style->label(),
]);
$form['actions']['submit']['#value'] = $this->t('Update effect');
return $form;
}
/**
* {@inheritdoc}
*/
protected function prepareImageEffect($image_effect) {
return $this->imageStyle
->getEffect($image_effect);
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
ImageEffectEditForm | Provides an edit form for image effects. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.