Bug fix for empty route

This commit is contained in:
Dennis Eichhorn 2016-07-19 18:10:16 +02:00
parent c2e613ac95
commit ca8ea058a8

View File

@ -85,6 +85,10 @@ class Router
*/ */
public function add(string $route, $destination, string $verb = RouteVerb::GET) public function add(string $route, $destination, string $verb = RouteVerb::GET)
{ {
if(!isset($this->routes[$route])) {
$this->routes[$route] = [];
}
$this->routes[$route][] = [ $this->routes[$route][] = [
'dest' => $destination, 'dest' => $destination,
'verb' => $verb, 'verb' => $verb,