mbfisher / web
dev-master
2015-01-23 08:08 UTC
Requires
- symfony/http-foundation: ~2.5
- symfony/http-kernel: ~2.5
Requires (Dev)
- phpspec/phpspec: 2.0.*@dev
- phpunit/phpunit: ~4.0
- task/phpspec: @stable
- task/phpunit: @stable
- task/task: ~0.6
This package is not auto-updated.
Last update: 2025-01-14 03:39:19 UTC
README
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use mbfisher\Web\Router\Router; use mbfisher\Web\Router\UrlMatcher\UrlMatcher; use mbfisher\Web\Route\Route; use mbfisher\Web\Dispatcher\ClosureDispatcher; $router = new Router(new UrlMatcher); $router->add(new Route('GET', '/', 'example')); $dispatcher = new ClosureDispatcher([ 'example' => function () { return new Response; } ]); $app = new Application($router, $dispatcher); $request = Request::create('/', 'GET'); $response = $app->handle($request); $response->send();