tylersmith102998 / GekPHP

An open-source framework for prototyping your projects
1 stars 0 forks source link

Router will detect not passing action as a 404, when it should point to index #21

Open tylersmith102998 opened 4 years ago

tylersmith102998 commented 4 years ago

Alter the way parsing the URI works in the breakdown function

tylersmith102998 commented 4 years ago

Fixed around this point in Route->breakDownRoute() if (!$this -> checkControllerMethodExists($controller, $method)) { $method = "Index"; $this->_404 = true; //throw new ControllerNotFoundException("Method {$method} is not a member of controller {$controller}", 405); }

tylersmith102998 commented 4 years ago

if (isset($route[0]) && !empty($route[0])) { $method = ucfirst($route[0]); unset($route[0]); $route = array_values($route); // See above; } This is the main code that fixed it.

tylersmith102998 commented 4 years ago

added the !empty() condition ^^