1. Go to this page and download the library: Download pklink/hahns 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/ */
pklink / hahns example snippets
$app = new \Hahns\Hahns();
$app->get('/', function () {
return "hello world!";
});
$app->delete('/', function () {
return "1";
});
$app = new \Hahns\Hahns(['debug' => true]);
$app->get('/', function (\Hahns\Request $request) {
// ...
});
$app->patch('/', function (\Hahns\Response\Json $response) {
// ...
});
$app->get('/cars', function (\Hahns\Response\Json $response, \Hahns\Request $request) {
// ...
});
mixed get(string $name) // get GET-param $name or null
mixed get(string $name, mixed $default) // get GET-param $name or $default
mixed header(string $name) // get param $name from request header or null
mixed header(string $name, mixed $default) // get param $name from request header or $default
mixed payload(string $name) // get param $name from payload (DELETE, PATCH, PUT) or null
mixed payload(string $name, mixed $default) // get param $name from payload (DELETE, PATCH, PUT) or $default
mixed post(string $name) // get POST-param $name or null
mixed post(string $name, mixed $default) // get POST-param $name or $default
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.