nigelgreenway / colonel
基于 StackPHP 的组件化框架,使用 PHP League 组件
v0.4.1
2016-06-03 14:56 UTC
Requires
- php: >=5.5.0
- league/container: ^1.3.2
- league/route: ^1.1.0
- symfony/http-kernel: ^2.6
Requires (Dev)
- filp/whoops: ^1.1
- phpunit/phpunit: ^4.6.6
- twig/twig: ^1.18.1
This package is auto-updated.
Last update: 2024-08-27 15:45:24 UTC
README
使用方法,只需添加
<?php require __DIR__ . '/../vendor/autoload.php'; $app = (new Colonel\HttpKernel( require_once __DIR__ . '/../Application/Configuration.php' ))->run();
示例配置文件
<?php return [ 'debug' => false, 'routes' => [ 'DemoBundle' => [ 'hello_world' => [ 'pattern' => '/your/pattern/{var}', 'controller' => 'Path\\To\\Class::method', 'method' => 'GET', ], ], ], 'services' => [ 'di' => [ 'Path\\To\\Some\\Dependency' => [ 'class' => 'Path\\To\\Some\\Dependency', 'arguments' => [ 'Path\\To\\Some\\Other\\Dependency', ], ], 'Path\\To\\Some\\Other\\Dependency' => [ 'class' => 'Path\\To\\Some\\Other\\Dependency', ], ], ], ];
这将很快完善...