1. Go to this page and download the library: Download nimbly/resolve 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/ */
nimbly / resolve example snippets
class Dispatcher
{
use Resolve;
public function __construct(
protected Router $router,
protected ContainterInterface $container)
{
}
public function dispatch(ServerRequestInterface $request): ResponseInterface
{
$route = $this->router->resolve($request);
$handler = $this->makeCallable($route->getHandler());
return $this->call(
$handler,
$this->container,
[ServerRequestInterface::class => $request]
);
}
}