function CropImageEffect::buildConfigurationForm
Same name in other branches
- 9 core/modules/image/src/Plugin/ImageEffect/CropImageEffect.php \Drupal\image\Plugin\ImageEffect\CropImageEffect::buildConfigurationForm()
- 10 core/modules/image/src/Plugin/ImageEffect/CropImageEffect.php \Drupal\image\Plugin\ImageEffect\CropImageEffect::buildConfigurationForm()
- 11.x core/modules/image/src/Plugin/ImageEffect/CropImageEffect.php \Drupal\image\Plugin\ImageEffect\CropImageEffect::buildConfigurationForm()
Overrides ResizeImageEffect::buildConfigurationForm
File
-
core/
modules/ image/ src/ Plugin/ ImageEffect/ CropImageEffect.php, line 58
Class
- CropImageEffect
- Crops an image resource.
Namespace
Drupal\image\Plugin\ImageEffectCode
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form = parent::buildConfigurationForm($form, $form_state);
$form['anchor'] = [
'#type' => 'radios',
'#title' => t('Anchor'),
'#options' => [
'left-top' => t('Top left'),
'center-top' => t('Top center'),
'right-top' => t('Top right'),
'left-center' => t('Center left'),
'center-center' => t('Center'),
'right-center' => t('Center right'),
'left-bottom' => t('Bottom left'),
'center-bottom' => t('Bottom center'),
'right-bottom' => t('Bottom right'),
],
'#theme' => 'image_anchor',
'#default_value' => $this->configuration['anchor'],
'#description' => t('The part of the image that will be retained during the crop.'),
];
return $form;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.