You are here

public function ThemeKeyRuleForm::validateForm in ThemeKey 8

Form validation handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormBase::validateForm

File

src/Form/ThemeKeyRuleForm.php, line 124
Contains Drupal\themekey\Form\ThemeKeyRuleForm.

Class

ThemeKeyRuleForm

Namespace

Drupal\themekey\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  $propertyAdmin = $this
    ->getPropertyAdminManager()
    ->createInstance($form_state
    ->getValue('property'));
  $value = $form_state
    ->getValue('value');
  if ($propertyAdmin) {
    $operator = $this
      ->getOperatorManager()
      ->createInstance($form_state
      ->getValue('operator'));
    $operator
      ->validate($propertyAdmin, $value, $form_state);
  }
}