function FormSubmitter::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Form/FormSubmitter.php \Drupal\Core\Form\FormSubmitter::__construct()
  2. 8.9.x core/lib/Drupal/Core/Form/FormSubmitter.php \Drupal\Core\Form\FormSubmitter::__construct()
  3. 11.x core/lib/Drupal/Core/Form/FormSubmitter.php \Drupal\Core\Form\FormSubmitter::__construct()

Constructs a new FormSubmitter.

Parameters

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

\Drupal\Core\Routing\UrlGeneratorInterface $url_generator: The URL generator.

\Drupal\Core\EventSubscriber\RedirectResponseSubscriber|null $redirect_response_subscriber: The redirect response subscriber.

File

core/lib/Drupal/Core/Form/FormSubmitter.php, line 48

Class

FormSubmitter
Provides submission processing for forms.

Namespace

Drupal\Core\Form

Code

public function __construct(RequestStack $request_stack, UrlGeneratorInterface $url_generator, ?RedirectResponseSubscriber $redirect_response_subscriber = NULL) {
    $this->requestStack = $request_stack;
    $this->urlGenerator = $url_generator;
    if (is_null($redirect_response_subscriber)) {
        @trigger_error('Calling ' . __CLASS__ . '::__construct() without the $redirect_response_subscriber argument is deprecated in drupal:10.2.0 and is required in drupal:11.0.0. See https://www.drupal.org/node/3377297', E_USER_DEPRECATED);
        $redirect_response_subscriber = \Drupal::service('redirect_response_subscriber');
    }
    $this->redirectResponseSubscriber = $redirect_response_subscriber;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.