And now if we try to access route /test with method POST, then it will return 404 Not Found, which is not very good status for this case. The router should return 405 Method Not Allowed instead.
In this commit, I've added a method findRoute() which finds a route, and returns the route action, method and the URI.
Think that our
public/index.php
file looks like this:And now if we try to access route
/test
with methodPOST
, then it will return404 Not Found
, which is not very good status for this case. The router should return405 Method Not Allowed
instead.In this commit, I've added a method
findRoute()
which finds a route, and returns the route action, method and the URI.@thecodeholic