PHP微框架:Bullet

WBOY
Release: 2016-06-20 12:52:39
Original
1550 people have browsed it

Bullet 是一个实用的 PHP 微框架,它可以让你十分容易地创建 REST API 和自动顺应 HTTP 标准需求的 Web 应用程序。Bullet 是一种资源,URI 导向,并且预装了强大的 HTTP 功能,例如内容协商和 caching。它有以下两个优点:

  • 超灵活的路径

  • 减少重复代码(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
Copy after login

项目主页:http://www.open-open.com/lib/view/home/1437227078006

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!