function TestToolkit::validateConfigurationForm

Same name in other branches
  1. 9 core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php \Drupal\image_test\Plugin\ImageToolkit\TestToolkit::validateConfigurationForm()
  2. 8.9.x core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php \Drupal\image_test\Plugin\ImageToolkit\TestToolkit::validateConfigurationForm()
  3. 10 core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php \Drupal\image_test\Plugin\ImageToolkit\TestToolkit::validateConfigurationForm()

Overrides ImageToolkitBase::validateConfigurationForm

File

core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/TestToolkit.php, line 111

Class

TestToolkit
Defines a Test toolkit for image manipulation within Drupal.

Namespace

Drupal\image_test\Plugin\ImageToolkit

Code

public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
    if ($form_state->getValue([
        'test',
        'test_parameter',
    ]) == 0) {
        $form_state->setErrorByName('test][test_parameter', $this->t('Test parameter should be different from 0.'));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.