diff --git a/src/Router.php b/src/Router.php index 79101d3..970b6af 100644 --- a/src/Router.php +++ b/src/Router.php @@ -7,14 +7,15 @@ class Router { public $controller; public $controllerPath; public $parameters = []; + public $requestType = 'get'; public function __construct() { $this->routes = $this->loadRoutes(); $this->path = $this->preparePath(); $this->query = $this->prepareQuery(); - $this->request = $this->getRequestType(); + $this->requestType = $this->getRequestType(); $this->controller = $this->findController(); - $this->controllerPath = $this->setRouteFile(); + $this->controllerPath = $this->setRouteFile(); } private function loadRoutes() { @@ -61,7 +62,7 @@ class Router { // one to one match if (array_key_exists($this->path, $this->routes)) { - return $this->routes[$this->path][$this->request]; + return $this->routes[$this->path][$this->requestType]; } foreach ($this->routes as $key => $value) {