layton / layton
The Layton PHP framework
dev-master
2018-06-30 12:04 UTC
Requires
- php: >=5.5.0
- psr/container: ^1.0
- psr/http-message: ^1.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- phpunit/phpunit: ^6
This package is not auto-updated.
Last update: 2024-05-01 07:56:31 UTC
README
Layton 是什么?
Layton 是一个基于 PHP 语言的网络框架
Layton 提倡用最简单直接的方式进行开发,从零开始构建自己的应用程序
Layton 提供一个极度自由的松耦合架构,最大限度的迎合使用者的思维方式和编程习惯。
Layton 提供了什么?
-
标准的 PSR-7 http 通信组件
-
高度自由的 URL 路由
-
PSR-11 标准容器(PSR Container)
-
高效的依赖注入驱动
如何安装?
composer require layton/layton dev-master
两种风格的 Hello World
- 极简风格
use Layton\Library\Http\Response; $app = new \Layton\App(); $app->get('/', function (Response $response) { return $response->html('Hello World!'); }); $app->start();
- 装饰器风格
use Layton\Library\Http\Response; $app = new \Layton\App(); $app->route('/', ['GET']) (function(Response $response) { return $response->html('Hello World!'); }); $app->start();