@@ -23,23 +23,35 @@ class CompiledRoute
23
23
private $ tokens ;
24
24
private $ staticPrefix ;
25
25
private $ regex ;
26
+ private $ pathVariables ;
27
+ private $ hostnameVariables;
28
+ private $ hostnameRegex ;
29
+ private $ hostnameTokens ;
26
30
27
31
/**
28
32
* Constructor.
29
33
*
30
- * @param Route $route A original Route instance
31
- * @param string $staticPrefix The static prefix of the compiled route
32
- * @param string $regex The regular expression to use to match this route
33
- * @param array $tokens An array of tokens to use to generate URL for this route
34
- * @param array $variables An array of variables
34
+ * @param Route $route A original Route instance
35
+ * @param string $staticPrefix The static prefix of the compiled route
36
+ * @param string $regex The regular expression to use to match this route
37
+ * @param array $tokens An array of tokens to use to generate URL for this route
38
+ * @param array $variables An array of variables
39
+ * @param array $pathVariables An array of path variables
40
+ * @param array $hostnameVariables An array of hostname variables
41
+ * @param array $hostnameRegex Hostname regex
42
+ * @param array $hostnameTokens Hostname tokens
35
43
*/
36
- public function __construct (Route $ route , $ staticPrefix , $ regex , array $ tokens , array $ variables )
44
+ public function __construct (Route $ route , $ staticPrefix , $ regex , array $ tokens , array $ variables, array $ pathVariables = array (), array $ hostnameVariables = array (), $ hostnameRegex = null , array $ hostnameTokens = array () )
37
45
{
38
46
$ this ->route = $ route ;
39
47
$ this ->staticPrefix = $ staticPrefix ;
40
48
$ this ->regex = $ regex ;
41
49
$ this ->tokens = $ tokens ;
42
50
$ this ->variables = $ variables ;
51
+ $ this ->pathVariables = $ pathVariables ;
52
+ $ this ->hostnameVariables = $ hostnameVariables ;
53
+ $ this ->hostnameRegex = $ hostnameRegex ;
54
+ $ this ->hostnameTokens = $ hostnameTokens ;
43
55
}
44
56
45
57
/**
@@ -72,6 +84,16 @@ public function getRegex()
72
84
return $ this ->regex ;
73
85
}
74
86
87
+ /**
88
+ * Returns the hostname regex
89
+ *
90
+ * @return string The hostname regex
91
+ */
92
+ public function getHostnameRegex ()
93
+ {
94
+ return $ this ->hostnameRegex ;
95
+ }
96
+
75
97
/**
76
98
* Returns the tokens.
77
99
*
@@ -82,6 +104,16 @@ public function getTokens()
82
104
return $ this ->tokens ;
83
105
}
84
106
107
+ /**
108
+ * Returns the hostname tokens.
109
+ *
110
+ * @return array The tokens
111
+ */
112
+ public function getHostnameTokens ()
113
+ {
114
+ return $ this ->hostnameTokens ;
115
+ }
116
+
85
117
/**
86
118
* Returns the variables.
87
119
*
@@ -92,6 +124,26 @@ public function getVariables()
92
124
return $ this ->variables ;
93
125
}
94
126
127
+ /**
128
+ * Returns the path variables.
129
+ *
130
+ * @return array The variables
131
+ */
132
+ public function getPathVariables ()
133
+ {
134
+ return $ this ->pathVariables ;
135
+ }
136
+
137
+ /**
138
+ * Returns the hostname variables.
139
+ *
140
+ * @return array The variables
141
+ */
142
+ public function getHostnameVariables ()
143
+ {
144
+ return $ this ->hostnameVariables ;
145
+ }
146
+
95
147
/**
96
148
* Returns the pattern.
97
149
*
@@ -102,6 +154,16 @@ public function getPattern()
102
154
return $ this ->route ->getPattern ();
103
155
}
104
156
157
+ /**
158
+ * Returns the hostname pattern.
159
+ *
160
+ * @return string The pattern
161
+ */
162
+ public function getHostnamePattern ()
163
+ {
164
+ return $ this ->route ->getHostnamePattern ();
165
+ }
166
+
105
167
/**
106
168
* Returns the options.
107
169
*
0 commit comments