Created
February 29, 2016 13:03
-
-
Save NandoKstroNet/f0d787143050ad5c018d to your computer and use it in GitHub Desktop.
Silex Middlewares Pt-1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Silex\Application; | |
$app = new Application(); | |
/** | |
* Middlewares | |
**/ | |
$app->before(function(){ | |
//Exemplo | |
print 'Before Middleware | '; | |
}); | |
$app->after(function(){ | |
//Exemplo | |
print 'After Middleware | '; | |
}); | |
$app->finish(function(){ | |
//Exemplo | |
print 'Finish middleware'; | |
}); | |
/** | |
* Routers | |
* */ | |
$app->get('/', function(Application $app) { | |
return $app->escape(' Router Content | '); | |
}); | |
$app->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment