blackscorp/lazy-before-after-service-provider
最新稳定版本:v1.2.5
Composer 安装命令:
composer require blackscorp/lazy-before-after-service-provider
包简介
A service Provider for Silex to call before/after methods automatically
README 文档
README
A service Provider for Silex to call before/after methods automatically.
#Usage
Your bootstrap may look like this
<?php $app = new Application(); $app->register(new ServiceControllerServiceProvider()); $app->register(new LazyBeforeAfterServiceProvider()); $app['controller'] = $app->share(function(){ return MyController(); }); $app->get('/','controller:indexAction');
Now you can just add methods like "before", "after","before{MethodName}" and "after{MethodName}" without to specify it in your Router.
This is the same like
$app->get('/','controller:indexAction') ->before(function(){ //some logic })->after(function(){ //some logic });
But with the ability to do your checks in a "Base" Controller and extend from it.
The Provider Call the methods in following Order:
- Before
- BeforeAction
- Action(Called by Silex)
- AfterAction
- After
统计信息
- 总下载量: 35
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Mit
- 更新时间: 2015-05-15