You are here

protected function EntityDisplayModeBase::urlRouteParameters in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityDisplayModeBase.php \Drupal\Core\Entity\EntityDisplayModeBase::urlRouteParameters()
  2. 10 core/lib/Drupal/Core/Entity/EntityDisplayModeBase.php \Drupal\Core\Entity\EntityDisplayModeBase::urlRouteParameters()

Gets an array of placeholders for this entity.

Individual entity classes may override this method to add additional placeholders if desired. If so, they should be sure to replicate the property caching logic.

Parameters

string $rel: The link relationship type, for example: canonical or edit-form.

Return value

array An array of URI placeholders.

Overrides EntityBase::urlRouteParameters

File

core/lib/Drupal/Core/Entity/EntityDisplayModeBase.php, line 113

Class

EntityDisplayModeBase
Base class for config entity types with settings for form and view modes.

Namespace

Drupal\Core\Entity

Code

protected function urlRouteParameters($rel) {
  $uri_route_parameters = parent::urlRouteParameters($rel);
  if ($rel === 'add-form') {
    $uri_route_parameters['entity_type_id'] = $this
      ->getTargetType();
  }
  return $uri_route_parameters;
}