You are here

public function ImageAPIOptimizePipelineFormBase::form in Image Optimize (or ImageAPI Optimize) 8.3

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

Gets the actual form array to be built.

Overrides EntityForm::form

See also

\Drupal\Core\Entity\EntityForm::processForm()

\Drupal\Core\Entity\EntityForm::afterBuild()

1 call to ImageAPIOptimizePipelineFormBase::form()
ImageAPIOptimizePipelineEditForm::form in src/Form/ImageAPIOptimizePipelineEditForm.php
Gets the actual form array to be built.
1 method overrides ImageAPIOptimizePipelineFormBase::form()
ImageAPIOptimizePipelineEditForm::form in src/Form/ImageAPIOptimizePipelineEditForm.php
Gets the actual form array to be built.

File

src/Form/ImageAPIOptimizePipelineFormBase.php, line 51

Class

ImageAPIOptimizePipelineFormBase
Base form for image optimize pipeline add and edit forms.

Namespace

Drupal\imageapi_optimize\Form

Code

public function form(array $form, FormStateInterface $form_state) {
  $form['label'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Image optimize pipeline name'),
    '#default_value' => $this->entity
      ->label(),
    '#required' => TRUE,
  ];
  $form['name'] = [
    '#type' => 'machine_name',
    '#machine_name' => [
      'exists' => [
        $this->imageapiOptimizePipelineStorage,
        'load',
      ],
    ],
    '#default_value' => $this->entity
      ->id(),
    '#required' => TRUE,
  ];
  return parent::form($form, $form_state);
}