You are here

public function PanelsIPELayoutForm::validateForm in Panels 8.4

Same name and namespace in other branches
  1. 8.3 panels_ipe/src/Form/PanelsIPELayoutForm.php \Drupal\panels_ipe\Form\PanelsIPELayoutForm::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

panels_ipe/src/Form/PanelsIPELayoutForm.php, line 156

Class

PanelsIPELayoutForm
Provides a form for configuring a layout for use with the IPE.

Namespace

Drupal\panels_ipe\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if ($this->layout instanceof PluginFormInterface) {
    $layout_form_state = (new FormState())
      ->setValues($form_state
      ->getValue('settings', []));
    $this->layout
      ->validateConfigurationForm($form, $layout_form_state);

    // Update the original form values.
    $form_state
      ->setValue('settings', $layout_form_state
      ->getValues());
  }
}