public function SiteConfigureForm::validateForm

public SiteConfigureForm::validateForm(array &$form, FormStateInterface $form_state)

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

core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php, line 250

Class

SiteConfigureForm
Provides the site configuration form.

Namespace

Drupal\Core\Installer\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if ($error = user_validate_name($form_state->getValue(array('account', 'name')))) {
    $form_state->setErrorByName('account][name', $error);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Installer!Form!SiteConfigureForm.php/function/SiteConfigureForm::validateForm/8.1.x