drupal/core/vendor/Symfony/Component/Routing
James Gilliland 5ae2b93226 Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
..
Annotation Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
Exception Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
Generator Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
Loader Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
Matcher Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
CompiledRoute.php Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
LICENSE Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
README.md Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
RequestContext.php Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
RequestContextAwareInterface.php Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
Route.php Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
RouteCollection.php Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
RouteCompiler.php Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
RouteCompilerInterface.php Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
Router.php Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
RouterInterface.php Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00
composer.json Updated Symfony router with HttpKernel request routing 2012-02-13 10:00:36 -05:00

README.md

Routing Component

Routing associates a request with the code that will convert it to a response.

The example below demonstrates how you can set up a fully working routing system:

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Matcher\UrlMatcher;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;

$routes = new RouteCollection();
$routes->add('hello', new Route('/hello', array('controller' => 'foo')));

$context = new RequestContext();

// this is optional and can be done without a Request instance
$context->fromRequest(Request::createFromGlobals());

$matcher = new UrlMatcher($routes, $context);

$parameters = $matcher->match('/hello');

Resources

Unit tests:

https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Component/Routing