You are here

public function UltimenuSettingsForm::validateForm in Ultimenu 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/UltimenuSettingsForm.php, line 190

Class

UltimenuSettingsForm
Defines ultimenu admin settings form.

Namespace

Drupal\ultimenu

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if (!$form_state
    ->isValueEmpty('skins') && !is_dir($form_state
    ->getValue('skins'))) {
    $form_state
      ->setErrorByName('skins', $this
      ->t('<strong>@skins</strong> do not exists. Please create the directory first.', array(
      '@skins' => $form_state
        ->getValue('skins'),
    )));
  }
  parent::validateForm($form, $form_state);
}