public function TestTextColorBehavior::validateConfigurationForm

Overrides ParagraphsBehaviorBase::validateConfigurationForm

File

paragraphs/tests/modules/paragraphs_test/src/Plugin/paragraphs/Behavior/TestTextColorBehavior.php, line 40

Class

TestTextColorBehavior
Provides a test feature plugin.

Namespace

Drupal\paragraphs_test\Plugin\paragraphs\Behavior

Code

public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
  if ($form_state
    ->getValue('default_color') == 'red') {
    $form_state
      ->setErrorByName('default_color', $this
      ->t('Red can not be used as the default color.'));
  }
}