20
20
21
21
class Domain extends RuleGroup
22
22
{
23
- protected $ bind ;
24
23
25
24
/**
26
25
* 架构函数
@@ -86,9 +85,7 @@ public function check($request, $url, $completeMatch = false)
86
85
*/
87
86
public function bind ($ bind )
88
87
{
89
- $ this ->bind = $ bind ;
90
88
$ this ->router ->bind ($ bind , $ this ->domain );
91
-
92
89
return $ this ;
93
90
}
94
91
@@ -117,8 +114,9 @@ private function checkRouteAlias($request, $url)
117
114
*/
118
115
private function checkUrlBind ($ request , $ url )
119
116
{
120
- if (!empty ($ this ->bind )) {
121
- $ bind = $ this ->bind ;
117
+ $ bind = $ this ->router ->getBind ($ this ->domain );
118
+
119
+ if (!empty ($ bind )) {
122
120
$ this ->parseBindAppendParam ($ bind );
123
121
124
122
// 记录绑定信息
@@ -165,10 +163,10 @@ protected function bindToClass($request, $url, $class)
165
163
$ action = !empty ($ array [0 ]) ? $ array [0 ] : $ this ->router ->config ('default_action ' );
166
164
167
165
if (!empty ($ array [1 ])) {
168
- $ this ->parseUrlParams ($ request , $ array [1 ]);
166
+ $ this ->parseUrlParams ($ request , $ array [1 ], $ param );
169
167
}
170
168
171
- return new CallbackDispatch ($ request , $ this , [$ class , $ action ]);
169
+ return new CallbackDispatch ($ request , $ this , [$ class , $ action ], $ param );
172
170
}
173
171
174
172
/**
@@ -186,10 +184,10 @@ protected function bindToNamespace($request, $url, $namespace)
186
184
$ method = !empty ($ array [1 ]) ? $ array [1 ] : $ this ->router ->config ('default_action ' );
187
185
188
186
if (!empty ($ array [2 ])) {
189
- $ this ->parseUrlParams ($ request , $ array [2 ]);
187
+ $ this ->parseUrlParams ($ request , $ array [2 ], $ param );
190
188
}
191
189
192
- return new CallbackDispatch ($ request , $ this , [$ namespace . '\\' . Loader::parseName ($ class , 1 ), $ method ]);
190
+ return new CallbackDispatch ($ request , $ this , [$ namespace . '\\' . Loader::parseName ($ class , 1 ), $ method ], $ param );
193
191
}
194
192
195
193
/**
@@ -206,10 +204,10 @@ protected function bindToController($request, $url, $controller)
206
204
$ action = !empty ($ array [0 ]) ? $ array [0 ] : $ this ->router ->config ('default_action ' );
207
205
208
206
if (!empty ($ array [1 ])) {
209
- $ this ->parseUrlParams ($ request , $ array [1 ]);
207
+ $ this ->parseUrlParams ($ request , $ array [1 ], $ param );
210
208
}
211
209
212
- return new ControllerDispatch ($ request , $ this , $ controller . '/ ' . $ action );
210
+ return new ControllerDispatch ($ request , $ this , $ controller . '/ ' . $ action, $ param );
213
211
}
214
212
215
213
/**
@@ -226,10 +224,10 @@ protected function bindToModule($request, $url, $controller)
226
224
$ action = !empty ($ array [0 ]) ? $ array [0 ] : $ this ->router ->config ('default_action ' );
227
225
228
226
if (!empty ($ array [1 ])) {
229
- $ this ->parseUrlParams ($ request , $ array [1 ]);
227
+ $ this ->parseUrlParams ($ request , $ array [1 ], $ param );
230
228
}
231
229
232
- return new ModuleDispatch ($ request , $ this , $ controller . '/ ' . $ action );
230
+ return new ModuleDispatch ($ request , $ this , $ controller . '/ ' . $ action, $ param );
233
231
}
234
232
235
233
}
0 commit comments