You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\Sugi\Router acts as a mapper between the HTTP requests (\Sugi\HTTP\Request) and your custom set of rules (\Sugi\HTTP\Route) to handle those requests.
Request
\Sugi\HTTP\Request represents a real HTTP request, giving you access to $_SERVER, $_GET, $_POST, $_COOKIE variables in a more convenient way. It also can produce customly defined requests mainly for unit testing purposes.
Route
\Sugi\HTTP\Route is a set of rules. If these rules match the request the router gives control to the function which is associated with the route. A simple MVC example:
$route = new \Sugi\HTTP\Route( "/{controller}/{action}/{id}", array("controller" => "main", "action" => "index", "id" => "" );
Second parameter is an optional array with default values for the path variables.