Skip to content

Instantly share code, notes, and snippets.

@NandoKstroNet
Created February 29, 2016 13:03
Show Gist options
  • Save NandoKstroNet/f0d787143050ad5c018d to your computer and use it in GitHub Desktop.
Save NandoKstroNet/f0d787143050ad5c018d to your computer and use it in GitHub Desktop.
Silex Middlewares Pt-1
<?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