4 * This file is part of the Symfony CMF package.
6 * (c) 2011-2015 Symfony CMF
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Cmf\Component\Routing;
15 * Document for redirection entries with the RedirectController.
17 * Defines additional methods needed by the RedirectController to redirect
20 * This document may define (in order of precedence - the others can be empty):
22 * - uri: an absolute uri
23 * - routeName and routeParameters: to be used with the standard symfony router
24 * or a route entry in the routeParameters for the DynamicRouter. Precedency
25 * between these is determined by the order of the routers in the chain
28 * With standard Symfony routing, you can just use uri / routeName and a
29 * hashmap of parameters.
31 * For the dynamic router, you can return a RouteInterface instance in the
32 * field 'route' of the parameters.
34 * Note: getRedirectContent must return the redirect route itself for the
35 * integration with DynamicRouter to work.
37 * @author David Buchmann <david@liip.ch>
39 interface RedirectRouteInterface extends RouteObjectInterface
42 * Get the absolute uri to redirect to external domains.
44 * If this is non-empty, the other methods won't be used.
46 * @return string target absolute uri
48 public function getUri();
51 * Get the target route document this route redirects to.
53 * If non-null, it is added as route into the parameters, which will lead
54 * to have the generate call issued by the RedirectController to have
55 * the target route in the parameters.
57 * @return RouteObjectInterface the route this redirection points to
59 public function getRouteTarget();
62 * Get the name of the target route for working with the symfony standard
65 * @return string target route name
67 public function getRouteName();
70 * Whether this should be a permanent or temporary redirect.
74 public function isPermanent();
77 * Get the parameters for the target route router::generate().
79 * Note that for the DynamicRouter, you return the target route
80 * document as field 'route' of the hashmap.
82 * @return array Information to build the route
84 public function getParameters();