Recommend this page to a friend! |
![]() ![]() |
Info | ![]() |
![]() |
![]() ![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 50 | All time: 10,575 This week: 177![]() |
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 |
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.