You are here

interface RouteObjectInterface in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony-cmf/routing/RouteObjectInterface.php \Symfony\Cmf\Component\Routing\RouteObjectInterface

Classes for entries in the routing table may implement this interface in addition to extending Symfony\Component\Routing\Route.

If they do, the DynamicRouter will request the route content and put it into the RouteObjectInterface::CONTENT_OBJECT field. The DynamicRouter will also request getRouteKey and this will be used instead of the symfony core compatible route name and can contain any characters.

Some fields in defaults have a special meaning in the getDefaults(). In addition to the constants defined in this class, _locale and _controller are also used.

Hierarchy

Expanded class hierarchy of RouteObjectInterface

All classes that implement RouteObjectInterface

44 files declare their use of RouteObjectInterface
AccessAwareRouterTest.php in core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php
Contains \Drupal\Tests\Core\Routing\AccessAwareRouterTest.
AccessManager.php in core/lib/Drupal/Core/Access/AccessManager.php
Contains \Drupal\Core\Access\AccessManager.
AccessManagerTest.php in core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php
Contains \Drupal\Tests\Core\Access\AccessManagerTest.
AuthenticationManagerTest.php in core/tests/Drupal/Tests/Core/Authentication/AuthenticationManagerTest.php
Contains \Drupal\Tests\Core\Authentication\AuthenticationManagerTest.
CurrentRouteMatchTest.php in core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php
Contains \Drupal\Tests\Core\Routing\CurrentRouteMatchTest.

... See full list

File

vendor/symfony-cmf/routing/RouteObjectInterface.php, line 26

Namespace

Symfony\Cmf\Component\Routing
View source
interface RouteObjectInterface {

  /**
   * Field name that will hold the route name that was matched.
   */
  const ROUTE_NAME = '_route';

  /**
   * Field name of the route object that was matched.
   */
  const ROUTE_OBJECT = '_route_object';

  /**
   * Field name for an explicit controller name to be used with this route
   */
  const CONTROLLER_NAME = '_controller';

  /**
   * Field name for an explicit template to be used with this route.
   * i.e. CmfContentBundle:StaticContent:index.html.twig
   */
  const TEMPLATE_NAME = '_template';

  /**
   * Field name for the content of the current route, if any.
   */
  const CONTENT_OBJECT = '_content';

  /**
   * Get the content document this route entry stands for. If non-null,
   * the ControllerClassMapper uses it to identify a controller and
   * the content is passed to the controller.
   *
   * If there is no specific content for this url (i.e. its an "application"
   * page), may return null.
   *
   * @return object the document or entity this route entry points to
   */
  public function getContent();

  /**
   * Get the route key.
   *
   * This key will be used as route name instead of the symfony core compatible
   * route name and can contain any characters.
   *
   * Return null if you want to use the default key.
   *
   * @return string the route name
   */
  public function getRouteKey();

}

Members

Namesort descending Modifiers Type Description Overrides
RouteObjectInterface::CONTENT_OBJECT constant Field name for the content of the current route, if any.
RouteObjectInterface::CONTROLLER_NAME constant Field name for an explicit controller name to be used with this route
RouteObjectInterface::getContent public function Get the content document this route entry stands for. If non-null, the ControllerClassMapper uses it to identify a controller and the content is passed to the controller. 2
RouteObjectInterface::getRouteKey public function Get the route key. 3
RouteObjectInterface::ROUTE_NAME constant Field name that will hold the route name that was matched.
RouteObjectInterface::ROUTE_OBJECT constant Field name of the route object that was matched.
RouteObjectInterface::TEMPLATE_NAME constant Field name for an explicit template to be used with this route. i.e. CmfContentBundle:StaticContent:index.html.twig