function DefaultsEntityForm::getEntityFromRouteMatch

Same name in other branches
  1. 9 core/modules/layout_builder/src/Form/DefaultsEntityForm.php \Drupal\layout_builder\Form\DefaultsEntityForm::getEntityFromRouteMatch()
  2. 8.9.x core/modules/layout_builder/src/Form/DefaultsEntityForm.php \Drupal\layout_builder\Form\DefaultsEntityForm::getEntityFromRouteMatch()
  3. 10 core/modules/layout_builder/src/Form/DefaultsEntityForm.php \Drupal\layout_builder\Form\DefaultsEntityForm::getEntityFromRouteMatch()

Overrides EntityForm::getEntityFromRouteMatch

File

core/modules/layout_builder/src/Form/DefaultsEntityForm.php, line 141

Class

DefaultsEntityForm
Provides a form containing the Layout Builder UI for defaults.

Namespace

Drupal\layout_builder\Form

Code

public function getEntityFromRouteMatch(RouteMatchInterface $route_match, $entity_type_id) {
    $route_parameters = $route_match->getParameters()
        ->all();
    return $this->entityTypeManager
        ->getStorage('entity_view_display')
        ->load($route_parameters['entity_type_id'] . '.' . $route_parameters['bundle'] . '.' . $route_parameters['view_mode_name']);
}

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