@@ -22,21 +22,33 @@ class CompiledRoute
22
22
private $ tokens ;
23
23
private $ staticPrefix ;
24
24
private $ regex ;
25
+ private $ pathVariables ;
26
+ private $ hostnameVariables ;
27
+ private $ hostnameRegex ;
28
+ private $ hostnameTokens ;
25
29
26
30
/**
27
31
* Constructor.
28
32
*
29
- * @param string $staticPrefix The static prefix of the compiled route
30
- * @param string $regex The regular expression to use to match this route
31
- * @param array $tokens An array of tokens to use to generate URL for this route
32
- * @param array $variables An array of variables
33
+ * @param string $staticPrefix The static prefix of the compiled route
34
+ * @param string $regex The regular expression to use to match this route
35
+ * @param array $tokens An array of tokens to use to generate URL for this route
36
+ * @param array $variables An array of variables
37
+ * @param array $pathVariables An array of path variables
38
+ * @param array $hostnameVariables An array of hostname variables
39
+ * @param array $hostnameRegex Hostname regex
40
+ * @param array $hostnameTokens Hostname tokens
33
41
*/
34
- public function __construct ($ staticPrefix , $ regex , array $ tokens , array $ variables )
42
+ public function __construct ($ staticPrefix , $ regex , array $ tokens , array $ variables, array $ pathVariables = array (), array $ hostnameVariables = array (), $ hostnameRegex = null , array $ hostnameTokens = array () )
35
43
{
36
44
$ this ->staticPrefix = $ staticPrefix ;
37
45
$ this ->regex = $ regex ;
38
46
$ this ->tokens = $ tokens ;
39
47
$ this ->variables = $ variables ;
48
+ $ this ->pathVariables = $ pathVariables ;
49
+ $ this ->hostnameVariables = $ hostnameVariables ;
50
+ $ this ->hostnameRegex = $ hostnameRegex ;
51
+ $ this ->hostnameTokens = $ hostnameTokens ;
40
52
}
41
53
42
54
/**
@@ -59,6 +71,16 @@ public function getRegex()
59
71
return $ this ->regex ;
60
72
}
61
73
74
+ /**
75
+ * Returns the hostname regex
76
+ *
77
+ * @return string The hostname regex
78
+ */
79
+ public function getHostnameRegex ()
80
+ {
81
+ return $ this ->hostnameRegex ;
82
+ }
83
+
62
84
/**
63
85
* Returns the tokens.
64
86
*
@@ -69,6 +91,16 @@ public function getTokens()
69
91
return $ this ->tokens ;
70
92
}
71
93
94
+ /**
95
+ * Returns the hostname tokens.
96
+ *
97
+ * @return array The tokens
98
+ */
99
+ public function getHostnameTokens ()
100
+ {
101
+ return $ this ->hostnameTokens ;
102
+ }
103
+
72
104
/**
73
105
* Returns the variables.
74
106
*
@@ -78,4 +110,25 @@ public function getVariables()
78
110
{
79
111
return $ this ->variables ;
80
112
}
113
+
114
+ /**
115
+ * Returns the path variables.
116
+ *
117
+ * @return array The variables
118
+ */
119
+ public function getPathVariables ()
120
+ {
121
+ return $ this ->pathVariables ;
122
+ }
123
+
124
+ /**
125
+ * Returns the hostname variables.
126
+ *
127
+ * @return array The variables
128
+ */
129
+ public function getHostnameVariables ()
130
+ {
131
+ return $ this ->hostnameVariables ;
132
+ }
133
+
81
134
}
0 commit comments