ImageStyleDeleteForm::form

public ImageStyleDeleteForm::form(array $form, FormStateInterface $form_state)

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 39

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 = $this->getReplacementOptions();
  // If there are non-empty options in the list, allow the user to optionally
  // pick up a replacement.
  if (count($replacement_styles) > 1) {
    $form['replacement'] = [
      '#type' => 'select',
      '#title' => $this->t('Replacement style'),
      '#options' => $replacement_styles,
      '#empty_option' => $this->t('- No replacement -'),
      '#weight' => -5,
    ];
  }

  return parent::form($form, $form_state);
}
doc_Drupal
2016-10-29 09:19:39
Comments
Leave a Comment

Please login to continue.