Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RotateImageEffect.php

function RotateImageEffect::validateConfigurationForm

Overrides ConfigurableImageEffectBase::validateConfigurationForm

File

core/modules/image/src/Plugin/ImageEffect/RotateImageEffect.php, line 112

Class

RotateImageEffect
Rotates an image resource.

Namespace

Drupal\image\Plugin\ImageEffect

Code

public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
    if (!$form_state->isValueEmpty('bgcolor') && !Color::validateHex($form_state->getValue('bgcolor'))) {
        $form_state->setErrorByName('bgcolor', $this->t('Background color must be a hexadecimal color value.'));
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal