annotate vendor/symfony-cmf/routing/RouteObjectInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 /*
Chris@0 4 * This file is part of the Symfony CMF package.
Chris@0 5 *
Chris@0 6 * (c) 2011-2015 Symfony CMF
Chris@0 7 *
Chris@0 8 * For the full copyright and license information, please view the LICENSE
Chris@0 9 * file that was distributed with this source code.
Chris@0 10 */
Chris@0 11
Chris@0 12 namespace Symfony\Cmf\Component\Routing;
Chris@0 13
Chris@0 14 /**
Chris@0 15 * Classes for entries in the routing table may implement this interface in
Chris@0 16 * addition to extending Symfony\Component\Routing\Route.
Chris@0 17 *
Chris@0 18 * If they do, the DynamicRouter will request the route content and put it into
Chris@0 19 * the RouteObjectInterface::CONTENT_OBJECT field. The DynamicRouter will also
Chris@0 20 * request getRouteKey and this will be used instead of the symfony core compatible
Chris@0 21 * route name and can contain any characters.
Chris@0 22 *
Chris@0 23 * Some fields in defaults have a special meaning in the getDefaults(). In addition
Chris@0 24 * to the constants defined in this class, _locale and _controller are also used.
Chris@0 25 */
Chris@0 26 interface RouteObjectInterface
Chris@0 27 {
Chris@0 28 /**
Chris@0 29 * Field name that will hold the route name that was matched.
Chris@0 30 */
Chris@0 31 const ROUTE_NAME = '_route';
Chris@0 32
Chris@0 33 /**
Chris@0 34 * Field name of the route object that was matched.
Chris@0 35 */
Chris@0 36 const ROUTE_OBJECT = '_route_object';
Chris@0 37
Chris@0 38 /**
Chris@0 39 * Field name for an explicit controller name to be used with this route.
Chris@0 40 */
Chris@0 41 const CONTROLLER_NAME = '_controller';
Chris@0 42
Chris@0 43 /**
Chris@0 44 * Field name for an explicit template to be used with this route.
Chris@0 45 * i.e. CmfContentBundle:StaticContent:index.html.twig.
Chris@0 46 */
Chris@0 47 const TEMPLATE_NAME = '_template';
Chris@0 48
Chris@0 49 /**
Chris@0 50 * Field name for the content of the current route, if any.
Chris@0 51 */
Chris@0 52 const CONTENT_OBJECT = '_content';
Chris@0 53
Chris@0 54 /**
Chris@0 55 * Field name for the content id of the current route, if any.
Chris@0 56 */
Chris@0 57 const CONTENT_ID = '_content_id';
Chris@0 58
Chris@0 59 /**
Chris@0 60 * Get the content document this route entry stands for. If non-null,
Chris@0 61 * the ControllerClassMapper uses it to identify a controller and
Chris@0 62 * the content is passed to the controller.
Chris@0 63 *
Chris@0 64 * If there is no specific content for this url (i.e. its an "application"
Chris@0 65 * page), may return null.
Chris@0 66 *
Chris@0 67 * @return object the document or entity this route entry points to
Chris@0 68 */
Chris@0 69 public function getContent();
Chris@0 70
Chris@0 71 /**
Chris@0 72 * Get the route name.
Chris@0 73 *
Chris@0 74 * Normal symfony routes do not know their name, the name is only known
Chris@0 75 * from the route collection. In the CMF, it is possible to use route
Chris@0 76 * documents outside of collections, and thus useful to have routes provide
Chris@0 77 * their name.
Chris@0 78 *
Chris@0 79 * There are no limitations to allowed characters in the name.
Chris@0 80 *
Chris@0 81 * @return string|null the route name or null to use the default name
Chris@0 82 * (e.g. from route collection if known)
Chris@0 83 */
Chris@0 84 public function getRouteKey();
Chris@0 85 }