You are here

public function ImageAPIOptimizeProcessorAddForm::buildForm in Image Optimize (or ImageAPI Optimize) 8.3

Same name and namespace in other branches
  1. 8.2 src/Form/ImageAPIOptimizeProcessorAddForm.php \Drupal\imageapi_optimize\Form\ImageAPIOptimizeProcessorAddForm::buildForm()
  2. 4.x src/Form/ImageAPIOptimizeProcessorAddForm.php \Drupal\imageapi_optimize\Form\ImageAPIOptimizeProcessorAddForm::buildForm()

Parameters

\Drupal\imageapi_optimize\ImageAPIOptimizePipelineInterface $imageapi_optimize_pipeline: The image optimize pipeline.

string $imageapi_optimize_processor: The image optimize processor ID.

Return value

array The form structure.

Throws

\Symfony\Component\HttpKernel\Exception\NotFoundHttpException

Overrides ImageAPIOptimizeProcessorFormBase::buildForm

File

src/Form/ImageAPIOptimizeProcessorAddForm.php, line 44

Class

ImageAPIOptimizeProcessorAddForm
Provides an add form for image optimize processors.

Namespace

Drupal\imageapi_optimize\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, ImageAPIOptimizePipelineInterface $imageapi_optimize_pipeline = NULL, $imageapi_optimize_processor = NULL) {
  $form = parent::buildForm($form, $form_state, $imageapi_optimize_pipeline, $imageapi_optimize_processor);
  $form['#title'] = $this
    ->t('Add %label processor', [
    '%label' => $this->imageAPIOptimizeProcessor
      ->label(),
  ]);
  $form['actions']['submit']['#value'] = $this
    ->t('Add processor');
  return $form;
}