| Recommend this page to a friend! |
| Info | Documentation | Reputation | Support forum | Blog | Links |
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not enough user ratings | Total: 51 | All time: 10,692 This week: 455 | ||||
| Version | License | PHP version | Categories | |||
| lazybeforeafterservi 1.0 | Custom (specified... | 5 | PHP 5, Libraries, Design Patterns |
| Description | Author | |
This package can call functions before or after a controller action. |
A service Provider for Silex to call before/after methods automatically.
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:
| File | Role | Description | ||
|---|---|---|---|---|
| Data | Auxiliary data | |||
| Data | Auxiliary data | |||
| Data | Auxiliary data | |||
| Lic. | License text | |||
| Data | Auxiliary data | |||
| Doc. | Documentation | |||
| / | src |
| File | Role | Description |
|---|---|---|
| |
Class | Class source |
| |
Class | Class source |
| / | test | / | Spy |
| File | Role | Description |
|---|---|---|
| |
Class | Class source |
| |
Class | Class source |
| |
Class | Class source |
| |
Class | Class source |
| |
Class | Class source |
| |
Class | Class source |
| |
Class | Class source |
| |
Class | Class source |
| |
Class | Class source |
| / | tests | / | integration |
| File | Role | Description |
|---|---|---|
| |
Class | Class source |
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
| lazybeforeafterservi-2017-05-04.zip 12KB | |
| lazybeforeafterservi-2017-05-04.tar.gz 7KB | |
| Install with Composer |
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% |
|
|
| Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.