fixed router typos

This commit is contained in:
Nick Yeoman 2024-09-16 06:54:02 -07:00
parent b858af3b55
commit 77b60d34f6

View File

@ -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) {