1. Go to this page and download the library: Download peterhorne/elmer 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/ */
peterhorne / elmer example snippets
use Elmer\Environment;
use Elmer\Response;
use Elmer\Routes;
return new Response(200, 'Hello, world!');
}
});
$response = $app(Environment::initFromGlobals());
$response->send();
$app->post();
$app->delete();
$app->brew(); // Custom methods are supported
$app->get('/users/:int', function($app, $id) {
return "You are user #$id";
});
:any // Anything (alpha, num, underscore, or dash)
:int // Any integer
:alpha // Any alphabetic character
:alphanum // Any alphanumeric character
:year // 4 digits
:month // 1 - 12
:day // 1 - 31