kekrozsak/vendor/symfony/symfony/src/Symfony/Component/Routing
Polonkai Gergely b82b4ffd34 Made document editing possible 2012-07-22 19:38:00 +02:00
..
Annotation Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
Exception Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
Generator Updated to Symfony 2.1 BETA3 2012-07-16 21:40:19 +02:00
Loader Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
Matcher Updated to Symfony 2.1 BETA3 2012-07-16 21:40:19 +02:00
Tests Updated to Symfony 2.1 BETA3 2012-07-16 21:40:19 +02:00
.gitignore Updated to Symfony 2.1 BETA3 2012-07-16 21:40:19 +02:00
CHANGELOG.md Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
CompiledRoute.php Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
LICENSE Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
README.md Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
RequestContext.php Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
RequestContextAwareInterface.php Updated to Symfony 2.1 BETA3 2012-07-16 21:40:19 +02:00
Route.php Made document editing possible 2012-07-22 19:38:00 +02:00
RouteCollection.php Upgraded to Symfony 2.1-beta2 2012-07-15 14:56:31 +02:00
RouteCompiler.php Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
RouteCompilerInterface.php Updated to Symfony 2.1 BETA3 2012-07-16 21:40:19 +02:00
Router.php Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
RouterInterface.php Updated to Symfony 2.1 BETA3 2012-07-16 21:40:19 +02:00
composer.json Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02:00
phpunit.xml.dist Initial commit with Symfony 2.1+Vendors 2012-07-01 09:52:20 +02: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

You can run the unit tests with the following command:

phpunit

If you also want to run the unit tests that depend on other Symfony Components, install dev dependencies before running PHPUnit:

php composer.phar install --dev