You are here

public function ImageStyleDeleteForm::form in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/image/src/Form/ImageStyleDeleteForm.php \Drupal\image\Form\ImageStyleDeleteForm::form()

Gets the actual form array to be built.

Overrides EntityForm::form

See also

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

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

File

core/modules/image/src/Form/ImageStyleDeleteForm.php, line 34
Contains \Drupal\image\Form\ImageStyleDeleteForm.

Class

ImageStyleDeleteForm
Creates a form to delete an image style.

Namespace

Drupal\image\Form

Code

public function form(array $form, FormStateInterface $form_state) {
  $replacement_styles = array_diff_key(image_style_options(), array(
    $this->entity
      ->id() => '',
  ));
  $form['replacement'] = array(
    '#title' => $this
      ->t('Replacement style'),
    '#type' => 'select',
    '#options' => $replacement_styles,
    '#empty_option' => $this
      ->t('No replacement, just delete'),
  );
  return parent::form($form, $form_state);
}