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

Breadcrumb

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

interface RouterInterface

RouterInterface is the interface that all Router classes must implement.

This interface is the concatenation of UrlMatcherInterface and UrlGeneratorInterface.

@author Fabien Potencier <fabien@symfony.com>

Hierarchy

  • interface \Symfony\Component\Routing\Generator\UrlGeneratorInterface extends \Symfony\Component\Routing\RequestContextAwareInterface; interface \Symfony\Component\Routing\Matcher\UrlMatcherInterface extends \Symfony\Component\Routing\RequestContextAwareInterface
    • interface \Symfony\Component\Routing\RouterInterface extends \Symfony\Component\Routing\Matcher\UrlMatcherInterface \Symfony\Component\Routing\Generator\UrlGeneratorInterface

Expanded class hierarchy of RouterInterface

All classes that implement RouterInterface

5 files declare their use of RouterInterface
AccessAwareRouter.php in core/lib/Drupal/Core/Routing/AccessAwareRouter.php
AccessAwareRouterInterface.php in core/lib/Drupal/Core/Routing/AccessAwareRouterInterface.php
DynamicLocalTasks.php in core/modules/content_moderation/src/Plugin/Derivative/DynamicLocalTasks.php
EntityAccessChecker.php in core/modules/jsonapi/src/Access/EntityAccessChecker.php
Router.php in core/lib/Drupal/Core/Routing/Router.php

File

vendor/symfony/routing/RouterInterface.php, line 24

Namespace

Symfony\Component\Routing
View source
interface RouterInterface extends UrlMatcherInterface, UrlGeneratorInterface {
    
    /**
     * Gets the RouteCollection instance associated with this Router.
     *
     * WARNING: This method should never be used at runtime as it is SLOW.
     *          You might use it in a cache warmer though.
     */
    public function getRouteCollection() : RouteCollection;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
RequestContextAwareInterface::getContext public function Gets the request context. 6
RequestContextAwareInterface::setContext public function Sets the request context. 6
RouterInterface::getRouteCollection public function Gets the RouteCollection instance associated with this Router. 3
UrlGeneratorInterface::ABSOLUTE_PATH public constant Generates an absolute path, e.g. &quot;/dir/file&quot;.
UrlGeneratorInterface::ABSOLUTE_URL public constant Generates an absolute URL, e.g. &quot;http://example.com/dir/file&quot;.
UrlGeneratorInterface::generate public function Generates a URL or path for a specific route based on the given parameters. 6
UrlGeneratorInterface::NETWORK_PATH public constant Generates a network path, e.g. &quot;//example.com/dir/file&quot;.
Such reference reuses the current scheme but specifies the host.
UrlGeneratorInterface::RELATIVE_PATH public constant Generates a relative path based on the current request path, e.g. &quot;../parent-file&quot;.
UrlMatcherInterface::match public function Tries to match a URL path with a set of routes. 3

API Navigation

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