You are here

public function FormBuilder::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Form/FormBuilder.php \Drupal\Core\Form\FormBuilder::__construct()
  2. 10 core/lib/Drupal/Core/Form/FormBuilder.php \Drupal\Core\Form\FormBuilder::__construct()

Constructs a new FormBuilder.

Parameters

\Drupal\Core\Form\FormValidatorInterface $form_validator: The form validator.

\Drupal\Core\Form\FormSubmitterInterface $form_submitter: The form submission processor.

\Drupal\Core\Form\FormCacheInterface $form_cache: The form cache.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Symfony\Contracts\EventDispatcher\EventDispatcherInterface $event_dispatcher: The event dispatcher.

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

\Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver: The class resolver.

\Drupal\Core\Render\ElementInfoManagerInterface $element_info: The element info manager.

\Drupal\Core\Theme\ThemeManagerInterface $theme_manager: The theme manager.

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

File

core/lib/Drupal/Core/Form/FormBuilder.php, line 173

Class

FormBuilder
Provides form building and processing.

Namespace

Drupal\Core\Form

Code

public function __construct(FormValidatorInterface $form_validator, FormSubmitterInterface $form_submitter, FormCacheInterface $form_cache, ModuleHandlerInterface $module_handler, EventDispatcherInterface $event_dispatcher, RequestStack $request_stack, ClassResolverInterface $class_resolver, ElementInfoManagerInterface $element_info, ThemeManagerInterface $theme_manager, CsrfTokenGenerator $csrf_token = NULL) {
  $this->formValidator = $form_validator;
  $this->formSubmitter = $form_submitter;
  $this->formCache = $form_cache;
  $this->moduleHandler = $module_handler;
  $this->eventDispatcher = $event_dispatcher;
  $this->requestStack = $request_stack;
  $this->classResolver = $class_resolver;
  $this->elementInfo = $element_info;
  $this->csrfToken = $csrf_token;
  $this->themeManager = $theme_manager;
}