$routes
$routes : array
This component represents the application as a set of HTTP rules.
add(\Gishiki\Core\Router\RouteInterface $route)
Equals to call register, accepts a value.
\Gishiki\Core\Router\RouteInterface | $route | the route to be added |
register(\Gishiki\Core\Router\RouteInterface $route)
Register a route within this router.
\Gishiki\Core\Router\RouteInterface | $route | the route to be registered |
run(\Psr\Http\Message\RequestInterface $requestToFulfill, \Psr\Http\Message\ResponseInterface $response, array $controllerArgs = array(), \Gishiki\Core\Application|null $app = null)
Run the router and serve the current request.
This function is CALLED INTERNALLY and, therefore it MUST NOT be called by the user!
\Psr\Http\Message\RequestInterface | $requestToFulfill | the request to be served/fulfilled |
\Psr\Http\Message\ResponseInterface | $response | the response to be filled |
array | $controllerArgs | an associative array with more parameters to be passed to the called controller |
\Gishiki\Core\Application|null | $app | the current application instance |
search(string $method, string $url, array $params, array $get) : null|\Gishiki\Core\Router\Route
Check if the given url and method match a route (even a non-200 OK route is allowed).
string | $method | the HTTP used verb |
string | $url | the url decoded string of the called url |
array | $params | will contains matched url slices |
array | $get | will contains matched url get options |
the matched route or null
checkNotAllowed(string $requestURL, string $requestMethod) : boolean
Check if the given URL matches a rule in a HTTP method different from the one used to perform the request.
string | $requestURL | the HTTP used address |
string | $requestMethod | the HTTP method used to query the resource |
true if the given url is matched in some other methods