Silex is a simple web framework to develop simple websites based on Symfony2 components:
<?php
require_once __DIR__.'/../vendor/autoload.php';
$app = new Silex\Application();
$app->get('/hello/{name}', function ($name) use ($app) {
return 'Hello '.$app->escape($name);
});
$app->run();
Silex works with PHP 5.3.3 or later.
The recommended way to install Silex is through
composer. Just create a composer.json
file and
run the php composer.phar install
command to install it:
{
"require": {
"silex/silex": "1.0.*"
}
}
Alternatively, you can download the silex.zip
file and extract it.
Read the documentation for more information.
To run the test suite, you need composer and PHPUnit.
$ php composer.phar install --dev
$ phpunit
Silex is licensed under the MIT license.