jabernardo / calf
PHP Web 应用程序的精简路由器
1.0.1
2021-05-15 15:24 UTC
Requires
- php: >=7.0
- jabernardo/saddle: ^0.1.0
Requires (Dev)
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2024-09-23 20:03:28 UTC
README
又一个PHP微框架。
安装
composer require jabernardo/calf
Hello World
<?php require("vendor/autoload.php"); $app = new \Calf\App(); $home = new \Calf\HTTP\Route('/', function($req, $res) { return $res->write('Hello World!'); }); $app->add($home); $app->run();
配置Web服务器
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ index.php [QSA,L]
运行...
php -S localhost:8888 index.php
测试
phpunit
了解更多
请参阅项目的wiki页面这里。
许可证
calf
是开源软件,遵循MIT许可证。