CodeExplorer getDefaultToolkit example
public function defaultConfiguration() { return [ 'extension' => NULL,
];
} /**
* {@inheritdoc}
*/
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' =>
$this->
t('Convert to'
),
'#default_value' =>
$this->configuration
['extension'
],
'#required' => TRUE,
'#options' =>
$options,
];