You are here

protected function HtmlFormController::getFormObject in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Controller/HtmlFormController.php \Drupal\Core\Controller\HtmlFormController::getFormObject()
  2. 10 core/lib/Drupal/Core/Controller/HtmlFormController.php \Drupal\Core\Controller\HtmlFormController::getFormObject()

Returns the object used to build the form.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.

string $form_arg: Either a class name or a service ID.

Return value

\Drupal\Core\Form\FormInterface The form object to use.

Overrides FormController::getFormObject

File

core/lib/Drupal/Core/Controller/HtmlFormController.php, line 47

Class

HtmlFormController
Wrapping controller for forms that serve as the main page body.

Namespace

Drupal\Core\Controller

Code

protected function getFormObject(RouteMatchInterface $route_match, $form_arg) {
  return $this->classResolver
    ->getInstanceFromDefinition($form_arg);
}