1. Go to this page and download the library: Download 1d98/framework 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/ */
1d98 / framework example snippets
use Framework\Http\Request\Request;
use Framework\Http\Response\Response;
use Framework\Http\Router\Router;
$router = new Router();
$router->get('/hello/{name}', static fn(Request $r, array $p): Response
=> Response::text("Hello, {$p['name']}!"));
use Framework\Http\Request\Request;
use Framework\Http\Response\ResponseInterface;
use Framework\Http\Response\Sse;
use Framework\Http\Response\StreamedResponse;
$router->get('/events', static fn(Request $r): ResponseInterface
=> StreamedResponse::sse(static function ($stream): void {
Sse::event($stream, json_encode(['n' => 0]), event: 'tick');
}));
bash
php bin/framework
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.