line / line
非常轻量级的PHP微框架
1.1.0
2015-07-10 19:14 UTC
Requires (Dev)
- phpunit/phpunit: ~4.4
This package is auto-updated.
Last update: 2024-09-08 22:17:31 UTC
README
Line是一个非常轻量级的PHP微框架。它具有以下特点
- 非常容易使用。
- 您可以扩展和替换所有组件。
- 灵活的控制器定义。
- 它只做它需要的事情(如果您需要更多,只需扩展它)。
通过Composer安装
运行 composer require line/line。
示例用法
// match URLs to their Controller $routes = [ '/' => [ 'name' => 'index', 'controller' => 'SomeController:index', ], '/article/<id>' => [ 'name' => 'article', 'controller' => function ($id) { // show article }, ], ]; // define Controller for error page (optional but recommended) $errorController = 'ErrorController:showError'; // create App object $router = new \Line\Routing\Router($routes, $errorController); $app = new \Line\App($router); // show backtrace on errors $app->debug = true; // run application $app->run();
更多信息请参阅 文档。
许可协议
MIT许可协议。