You are here

public function SlickForm::validateForm in Slick Carousel 8

Same name and namespace in other branches
  1. 8.2 slick_ui/src/Form/SlickForm.php \Drupal\slick_ui\Form\SlickForm::validateForm()

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

slick_ui/src/Form/SlickForm.php, line 741

Class

SlickForm
Extends base form for slick instance configuration form.

Namespace

Drupal\slick_ui\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  parent::validateForm($form, $form_state);

  // Update CSS Bezier version.
  $override = $form_state
    ->getValue([
    'options',
    'settings',
    'cssEaseOverride',
  ]);
  if ($override) {
    $override = $this
      ->getBezier($override);
  }

  // Update cssEaseBezier value based on cssEaseOverride.
  $form_state
    ->setValue([
    'options',
    'settings',
    'cssEaseBezier',
  ], $override);
}