function FormController::__construct

Same name in this branch
  1. 8.9.x core/modules/system/tests/modules/condition_test/src/FormController.php \Drupal\condition_test\FormController::__construct()
Same name in other branches
  1. 9 core/modules/system/tests/modules/condition_test/src/FormController.php \Drupal\condition_test\FormController::__construct()
  2. 9 core/lib/Drupal/Core/Controller/FormController.php \Drupal\Core\Controller\FormController::__construct()
  3. 10 core/modules/system/tests/modules/condition_test/src/FormController.php \Drupal\condition_test\FormController::__construct()
  4. 10 core/lib/Drupal/Core/Controller/FormController.php \Drupal\Core\Controller\FormController::__construct()
  5. 11.x core/modules/system/tests/modules/condition_test/src/FormController.php \Drupal\condition_test\FormController::__construct()
  6. 11.x core/lib/Drupal/Core/Controller/FormController.php \Drupal\Core\Controller\FormController::__construct()

Constructs a new \Drupal\Core\Controller\FormController object.

Parameters

\Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface $argument_resolver: The argument resolver.

\Drupal\Core\Form\FormBuilderInterface $form_builder: The form builder.

2 calls to FormController::__construct()
HtmlEntityFormController::__construct in core/lib/Drupal/Core/Entity/HtmlEntityFormController.php
Constructs a new \Drupal\Core\Routing\Enhancer\FormEnhancer object.
HtmlFormController::__construct in core/lib/Drupal/Core/Controller/HtmlFormController.php
Constructs a new \Drupal\Core\Routing\Enhancer\FormEnhancer object.
2 methods override FormController::__construct()
HtmlEntityFormController::__construct in core/lib/Drupal/Core/Entity/HtmlEntityFormController.php
Constructs a new \Drupal\Core\Routing\Enhancer\FormEnhancer object.
HtmlFormController::__construct in core/lib/Drupal/Core/Controller/HtmlFormController.php
Constructs a new \Drupal\Core\Routing\Enhancer\FormEnhancer object.

File

core/lib/Drupal/Core/Controller/FormController.php, line 54

Class

FormController
Common base class for form interstitial controllers.

Namespace

Drupal\Core\Controller

Code

public function __construct(ArgumentResolverInterface $argument_resolver, FormBuilderInterface $form_builder) {
    $this->argumentResolver = $argument_resolver;
    if ($argument_resolver instanceof ControllerResolverInterface) {
        @trigger_error("Using the 'controller_resolver' service as the first argument is deprecated, use the 'http_kernel.controller.argument_resolver' instead. If your subclass requires the 'controller_resolver' service add it as an additional argument. See https://www.drupal.org/node/2959408.", E_USER_DEPRECATED);
        $this->controllerResolver = $argument_resolver;
    }
    $this->formBuilder = $form_builder;
}

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