1. Go to this page and download the library: Download adaiasmagdiel/erlenmeyer 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/ */
adaiasmagdiel / erlenmeyer example snippets
AdaiasMagdiel\Erlenmeyer\App;
use AdaiasMagdiel\Erlenmeyer\Request;
use AdaiasMagdiel\Erlenmeyer\Response;
$app = new App();
$app->get('/', function (Request $req, Response $res) {
$res->withHtml("<h1>Welcome to Erlenmeyer!</h1>")->send();
});
$app->run();
$app->addMiddleware(function (Request $req, Response $res, callable $next) {
$start = microtime(true);
$next($req, $res); // Calls the next handler in the chain
$time = microtime(true) - $start;
echo "<p>Execution time: $time seconds</p>";
});