Centum\Router

MVC web apps can be created using Centum\Router\Router.

Centum\Router\Router(
    Centum\Interfaces\Container\ContainerInterface $container
);

Centum\Router\Router implements Centum\Interfaces\Router\RouterInterface.

The Router’s job is to convert a Centum\Interfaces\Http\RequestInterface object into a Centum\Interfaces\Http\ResponseInterface object:

$response = $router->handle($request);

It does so by extracting the Request’s URI and method, it iterates through the Routes until it finds one that matches, and then executes the Controller’s code which returns a Response.


Table of contents