From 6713ae6735eb46119f7e05a04a0653528da7cf62 Mon Sep 17 00:00:00 2001 From: VeeeneX Date: Mon, 6 Jul 2015 23:18:24 +0200 Subject: [PATCH] Fixed creation of routes --- src/Router.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Router.php b/src/Router.php index 95e92fa..af8aa50 100644 --- a/src/Router.php +++ b/src/Router.php @@ -324,12 +324,20 @@ public function addRoute($method, $route, $action, $name = null, $definitions = //unset($methods[$i]); } } + if ($name === null) { + $this->rawRoutes[] = [ + 'route' => $this->baseUri.$route, + 'method' => $methods, + "definitions" => $definitions + ]; + } else { + $this->rawRoutes[$name] = [ + 'route' => $this->baseUri.$route, + 'method' => $methods, + "definitions" => $definitions + ]; + } - $this->rawRoutes[$name] = [ - 'route' => $this->baseUri.$route, - 'method' => $methods, - "definitions" => $definitions - ]; } /**