Silex, a simple Web Framework
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(
'/hello/:name' => function($name)
{
return new Response('Hello '.$name);
},
'GET|PUT|POST /goodbye/:name' => function($name)
{
return new Response('Goodbye '.$name);
},
));
$framework->run();
Silex is based on Symfony2.
Requirements
Silex works with PHP 5.3.2 or later.
Installation
Installing Silex is as easy as it can get. Download the Silex.phar
file
and you're done!
More Information
Read the documentation of Symfony2 for more information about how you can leverage Symfony2 features.
License
Silex is licensed under the MIT license.