1. Go to this page and download the library: Download kode/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/ */
kode / framework example snippets
// app/controllers/HelloController.php
namespace app\controllers;
use Kode\Framework\Http\Controller;
final class HelloController extends Controller
{
public function say(): array
{
$name = $this->input('name', '世界');
return ['hello' => $name]; // 直接返回数组 → 自动 JSON 化
}
}
// app/routes.php
use Kode\Http\App;
use app\controllers\HelloController;
return function (App $app): void {
$app->get('/hello', fn() => resolve(HelloController::class)->say());
};