function HtmlEntityFormController::getFormArgument

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/HtmlEntityFormController.php \Drupal\Core\Entity\HtmlEntityFormController::getFormArgument()
  2. 8.9.x core/lib/Drupal/Core/Entity/HtmlEntityFormController.php \Drupal\Core\Entity\HtmlEntityFormController::getFormArgument()
  3. 11.x core/lib/Drupal/Core/Entity/HtmlEntityFormController.php \Drupal\Core\Entity\HtmlEntityFormController::getFormArgument()

Extracts the form argument string from a request.

Depending on the type of form the argument string may be stored in a different request attribute.

One example of a route definition is given below.

defaults:
_form:
Drupal\example\Form\ExampleForm;

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match object from which to extract a form definition string.

Return value

string The form definition string.

Overrides FormController::getFormArgument

File

core/lib/Drupal/Core/Entity/HtmlEntityFormController.php, line 40

Class

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

Namespace

Drupal\Core\Entity

Code

protected function getFormArgument(RouteMatchInterface $route_match) {
    return $route_match->getRouteObject()
        ->getDefault('_entity_form');
}

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