Silex is a simple web framework to develop simple websites:
require_once __DIR__.'/silex.phar';
use Symfony\Component\HttpFoundation\Response;
use Silex\Framework;
$framework = new Framework(array(
'GET /hello/:name' => function($name)
{
return new Response('Hello '.$name);
},
'POST /goodbye/:name' => function($name)
{
return new Response('Goodbye '.$name);
},
));
$framework->handle()->send();
Silex is based on Symfony2.
Silex works with PHP 5.3.2 or later.
Installing Silex is as easy as it can get. Download the Silex.phar
file
and you're done!
Read the documentation of Symfony2 for more information about how you can leverage Symfony2 features.
Silex is licensed under the MIT license.