1. Go to this page and download the library: Download jowy/routing-middleware library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jowy / routing-middleware example snippets
use Zend\Stratigility\MiddlewarePipe;
use Jowy\Routing\Routing;
$app = new MiddlewarePipe();
$route_middleware = new Routing($options);
$app->pipe($route_middleware);
use Pimple\Container;
use Relay\Relay;
use Jowy\Routing\Routing;
$container = new Container();
$container["middleware"] = [
Routing::class => function() {
return new Routing($options);
}
];
$resolver = function ($class) use ($container) {
return $container[$class];
}
new Relay(array_keys($container["middleware"], $resolver);