Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RouteSubscriber.php

function RouteSubscriber::setUpBaseRoute

Gets parameters from a base route and saves them in class variables.

Parameters

string $base_route_name: The name of a base route that already has a BC variant.

Return value

bool TRUE if all parameters are set, FALSE if not.

1 call to RouteSubscriber::setUpBaseRoute()
RouteSubscriber::alterRoutes in core/modules/block_content/src/Routing/RouteSubscriber.php
Alters existing routes for a specific collection.

File

core/modules/block_content/src/Routing/RouteSubscriber.php, line 101

Class

RouteSubscriber
Subscriber for Block content BC routes.

Namespace

Drupal\block_content\Routing

Code

protected function setUpBaseRoute(string $base_route_name) : bool {
    $base_route = $this->collection
        ->get($base_route_name);
    $base_route_bc = $this->collection
        ->get("{$base_route_name}.bc");
    if (empty($base_route) || empty($base_route_bc)) {
        return FALSE;
    }
    $this->basePath = $base_route->getPath();
    $this->basePathBc = $base_route_bc->getPath();
    $this->controller = $base_route_bc->getDefault('_controller');
    if (empty($this->basePath) || empty($this->basePathBc) || empty($this->controller) || $this->basePathBc === $this->basePath) {
        return FALSE;
    }
    return TRUE;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal