1. Go to this page and download the library: Download tsoffereins/nano 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/ */
tsoffereins / nano example snippets
$container = new Container();
$container->bind('abstract', 'concrete');
$instance = $container->make('abstract');
$container->bind('abstract', function()
{
return new Concrete('config');
});
$container->singleton('abstract', function()
{
return new Concrete('config');
});
class Middleware
{
public function handle($request, $next)
{
// Do something with request
$response = $next($request);
// Do something with response
return $response;
}
}