jasonmichels/lift-framework
Composer 安装命令:
composer require jasonmichels/lift-framework
包简介
Lift is a PHP 7 micro framework for building microservices
关键字:
README 文档
README
Lift - PHP 7 micro framework
Introduction
Lift is an opinionated PHP 7 micro framework
Example
declare(strict_types=1); require('../vendor/autoload.php'); use Lift\Framework\App; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\JsonResponse; use Lift\Framework\Http\Response; function getHomepage(Request $request): JsonResponse { $response = Response\json(); $response->setData(['data' => ['stuff' => 'is awesome']]); return $response; } function getUserHandler (Request $request, array $args): JsonResponse { $response = Response\json(); $response->setData(['data' => ['userId' => $args['id'], 'username' => 'Jason Michels']]); return $response; } $app = new App(); $routes = [ ['httpMethod' => Request::METHOD_GET, 'route' => '/', 'handler' => 'getHomepage'], ['httpMethod' => Request::METHOD_GET, 'route' => '/user/{id:\d+}', 'handler' => 'getUserHandler'] ]; $app->run($routes);
Testing
$ phpunit
- Be Awesome!
Language
- PHP 7
License
GroundworkPHP is open-sourced software licensed under the MIT license
Authors
- Jason Michels
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-06-15