forked from symfony-cmf/Routing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RedirectRouteInterface.php
76 lines (70 loc) · 2.24 KB
/
RedirectRouteInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
namespace Symfony\Cmf\Component\Routing;
/**
* Document for redirection entries with the RedirectController.
*
* Defines additional methods needed by the RedirectController to redirect
* based on the route.
*
* This document may define (in order of precedence - the others can be empty):
*
* - uri: an absolute uri
* - routeName and routeParameters: to be used with the standard symfony router
* or a route entry in the routeParameters for the DynamicRouter. Precedency
* between these is determined by the order of the routers in the chain
* router.
*
* With standard Symfony routing, you can just use uri / routeName and a
* hashmap of parameters.
*
* For the dynamic router, you can return a RouteInterface instance in the
* field 'route' of the parameters.
*
* Note: getRedirectContent must return the redirect route itself for the
* integration with DynamicRouter to work.
*
* @author David Buchmann <[email protected]>
*/
interface RedirectRouteInterface extends RouteObjectInterface
{
/**
* Get the absolute uri to redirect to external domains.
*
* If this is non-empty, the other methods won't be used.
*
* @return string target absolute uri
*/
public function getUri();
/**
* Get the target route document this route redirects to.
*
* If non-null, it is added as route into the parameters, which will lead
* to have the generate call issued by the RedirectController to have
* the target route in the parameters.
*
* @return RouteObjectInterface the route this redirection points to
*/
public function getRouteTarget();
/**
* Get the name of the target route for working with the symfony standard
* router.
*
* @return string target route name
*/
public function getRouteName();
/**
* Whether this should be a permanent or temporary redirect
*
* @return boolean
*/
public function isPermanent();
/**
* Get the parameters for the target route router::generate()
*
* Note that for the DynamicRouter, you return the target route
* document as field 'route' of the hashmap.
*
* @return array Information to build the route
*/
public function getParameters();
}