You are here

public function ResizeImageEffect::buildConfigurationForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php \Drupal\image\Plugin\ImageEffect\ResizeImageEffect::buildConfigurationForm()
  2. 9 core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php \Drupal\image\Plugin\ImageEffect\ResizeImageEffect::buildConfigurationForm()

File

core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php, line 66

Class

ResizeImageEffect
Resizes an image resource.

Namespace

Drupal\image\Plugin\ImageEffect

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  $form['width'] = [
    '#type' => 'number',
    '#title' => t('Width'),
    '#default_value' => $this->configuration['width'],
    '#field_suffix' => ' ' . t('pixels'),
    '#required' => TRUE,
    '#min' => 1,
  ];
  $form['height'] = [
    '#type' => 'number',
    '#title' => t('Height'),
    '#default_value' => $this->configuration['height'],
    '#field_suffix' => ' ' . t('pixels'),
    '#required' => TRUE,
    '#min' => 1,
  ];
  return $form;
}