|
@@ -40,7 +40,7 @@
|
|
|
}
|
|
|
}
|
|
|
public function handle($verb, $url, $data){
|
|
|
- $res = new Response();
|
|
|
+ $res = new Response($url);
|
|
|
$self = $this;
|
|
|
$onerror = function($res, $error){
|
|
|
$self->error($error);
|
|
@@ -87,18 +87,18 @@
|
|
|
if($router == false){
|
|
|
$router = $this->create_router($type, $prefix);
|
|
|
}
|
|
|
- $fn($router);
|
|
|
+ call_user_func($fn, $router);
|
|
|
}
|
|
|
public function prefix($prefix, Callable $fn){
|
|
|
$this->route('prefix', $prefix, function($router){
|
|
|
$router->base($prefix);
|
|
|
- $fn($router);
|
|
|
+ call_user_func($fn, $router);
|
|
|
});
|
|
|
}
|
|
|
public function domain($prefix, Callable $fn){
|
|
|
$this->route('domain', $prefix, function($router){
|
|
|
$router->base($prefix);
|
|
|
- $fn($router);
|
|
|
+ call_user_func($fn, $router);
|
|
|
});
|
|
|
}
|
|
|
}
|