W3cubDocs

/Drupal 8

public function FormValidator::__construct

public FormValidator::__construct(RequestStack $request_stack, TranslationInterface $string_translation, CsrfTokenGenerator $csrf_token, LoggerInterface $logger, FormErrorHandlerInterface $form_error_handler)

Constructs a new FormValidator.

Parameters

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation service.

\Drupal\Core\Access\CsrfTokenGenerator $csrf_token: The CSRF token generator.

\Psr\Log\LoggerInterface $logger: A logger instance.

\Drupal\Core\Form\FormErrorHandlerInterface $form_error_handler: The form error handler.

File

core/lib/Drupal/Core/Form/FormValidator.php, line 63

Class

FormValidator
Provides validation of form submissions.

Namespace

Drupal\Core\Form

Code

public function __construct(RequestStack $request_stack, TranslationInterface $string_translation, CsrfTokenGenerator $csrf_token, LoggerInterface $logger, FormErrorHandlerInterface $form_error_handler) {
  $this->requestStack = $request_stack;
  $this->stringTranslation = $string_translation;
  $this->csrfToken = $csrf_token;
  $this->logger = $logger;
  $this->formErrorHandler = $form_error_handler;
}

© 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!Form!FormValidator.php/function/FormValidator::__construct/8.1.x