public function ConvertImageEffect::buildConfigurationForm in Drupal 10
Same name and namespace in other branches
- 8 core/modules/image/src/Plugin/ImageEffect/ConvertImageEffect.php \Drupal\image\Plugin\ImageEffect\ConvertImageEffect::buildConfigurationForm()
- 9 core/modules/image/src/Plugin/ImageEffect/ConvertImageEffect.php \Drupal\image\Plugin\ImageEffect\ConvertImageEffect::buildConfigurationForm()
File
- core/
modules/ image/ src/ Plugin/ ImageEffect/ ConvertImageEffect.php, line 62
Class
- ConvertImageEffect
- Converts an image resource.
Namespace
Drupal\image\Plugin\ImageEffectCode
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$extensions = \Drupal::service('image.toolkit.manager')
->getDefaultToolkit()
->getSupportedExtensions();
$options = array_combine($extensions, array_map('mb_strtoupper', $extensions));
$form['extension'] = [
'#type' => 'select',
'#title' => t('Convert to'),
'#default_value' => $this->configuration['extension'],
'#required' => TRUE,
'#options' => $options,
];
return $form;
}