PHP code example of mclkim / kaiser
1. Go to this page and download the library: Download mclkim/kaiser 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/ */
mclkim / kaiser example snippets
use Mcl\Kaiser\Middleware\AuthMiddleware;
use Mcl\Kaiser\Middleware\RoutingMiddleware;
use Mcl\Kaiser\Middleware\SessionMiddleware;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
>getContainer(), __DIR__ . '/../app');
if ($route = $route()) {
$app->map($route['methods'], $route['pattern'], $route['handler'])
->add(new SessionMiddleware())
->add(new AuthMiddleware($route['callable']));
}
$app->run();
$ php -S localhost:8000 -t public public/index.php