You are here

public function MenuExportConfigurationForm::validateForm in Menu Import and Export 8

Custom form validation for menus.

Overrides FormBase::validateForm

File

src/Form/MenuExportConfigurationForm.php, line 59

Class

MenuExportConfigurationForm
Configure Menu Export settings.

Namespace

Drupal\menu_export\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  foreach ($form_state
    ->getValue('menus') as $val) {
    if ($val) {
      $menu[] = $val;
    }
  }
  $form_state
    ->setValue('menus', $menu);
  return parent::validateForm($form, $form_state);
}