dev-master
9999999-devFramework in one file
MIT
The Requires
framework
Wallogit.com
2017 © Pedro Peláez
Framework in one file
WebGlue is a tiny web framework. Actually it's nothing more than some glue between the Symfony HttpFoundation Request and Response object, and a very simple router. I find it helps me a lot for quick prototyping and small projects., (*1)
Very simple:, (*2)
$app-><method>(<route>, <callback>);
$app = new WebGlue;
// for routes accepting POST, use $app->post, etc.
$app->get('/', function($app, $request, $response){
$response->setContent('hello world');
});
$app->get('/greet/{name:string}', function($app, $request, $response){
$name = $request->attributes->get('name');
$response->setContent('hello ' . $name);
});
$app->run();
$app = new WebGlue;
// add the excellent Twig templating engine
$app['twig'] = new Twig_Environment(new Twig_Loader_Filesystem(__DIR__.'/templates'));
$app->get('/', function($app, $request, $response){
$response->setContent(app['twig']->render('hello_world.html.twig'));
});
Only master for now..., (*3)
{
"require" : {
"webglue/webglue": "dev-master"
}
}
and, (*4)
include __DIR__.'/vendor/autoload.php';
Framework in one file
MIT
framework