时间:2021-07-01 10:21:17 帮助过:20人阅读
超灵活的路径
减少重复代码(DRY)
示例代码:
$app = new Bullet\App();$app->path('foo', function($request) use($app) { return "foo";});$app->path('bar', function($request) use($app) { $foo = $app->run('GET', 'foo'); // $foo is now a `Bullet\Response` instance return $foo->content() . "bar";});echo $app->run('GET', 'bar'); // echos 'foobar' with a 200 OK status
项目主页:http://www.open-open.com/lib/view/home/1437227078006