You are here

public function ImageEffectAddForm::buildForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/image/src/Form/ImageEffectAddForm.php \Drupal\image\Form\ImageEffectAddForm::buildForm()
  2. 10 core/modules/image/src/Form/ImageEffectAddForm.php \Drupal\image\Form\ImageEffectAddForm::buildForm()

Parameters

array $form: A nested array form elements comprising the form.

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

\Drupal\image\ImageStyleInterface $image_style: The image style.

string $image_effect: The image effect ID.

Return value

array The form structure.

Throws

\Symfony\Component\HttpKernel\Exception\NotFoundHttpException

Overrides ImageEffectFormBase::buildForm

File

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

Class

ImageEffectAddForm
Provides an add form for image effects.

Namespace

Drupal\image\Form

Code

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('Add %label effect', [
    '%label' => $this->imageEffect
      ->label(),
  ]);
  $form['actions']['submit']['#value'] = $this
    ->t('Add effect');
  return $form;
}