class ModuleRouteSubscriber extends RouteSubscriberBase (View source)

A route subscriber to remove routes that depend on modules being enabled.

Properties

protected ModuleHandlerInterface $moduleHandler

The module handler.

Methods

alterRoutes(RouteCollection $collection)

Alters existing routes for a specific collection.

static 
getSubscribedEvents()

{@inheritdoc}

onAlterRoutes(RouteBuildEvent $event)

Delegates the route altering to self::alterRoutes().

__construct(ModuleHandlerInterface $module_handler)

Constructs a ModuleRouteSubscriber object.

array
explodeString(string $string, string $separator = ',')

Explodes a string based on a separator.

Details

protected alterRoutes(RouteCollection $collection)

Alters existing routes for a specific collection.

Parameters

RouteCollection $collection

The route collection for adding routes.

static getSubscribedEvents()

{@inheritdoc}

onAlterRoutes(RouteBuildEvent $event)

Delegates the route altering to self::alterRoutes().

Parameters

RouteBuildEvent $event

The route build event.

__construct(ModuleHandlerInterface $module_handler)

Constructs a ModuleRouteSubscriber object.

Parameters

ModuleHandlerInterface $module_handler

The module handler.

protected array explodeString(string $string, string $separator = ',')

Explodes a string based on a separator.

Parameters

string $string

The string to explode.

string $separator

The string separator to explode with.

Return Value

array

An array of exploded (and trimmed) values.