diff options
Diffstat (limited to 'vendor/symfony/routing/Symfony/Component/Routing/README.md')
-rw-r--r-- | vendor/symfony/routing/Symfony/Component/Routing/README.md | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/vendor/symfony/routing/Symfony/Component/Routing/README.md b/vendor/symfony/routing/Symfony/Component/Routing/README.md new file mode 100644 index 00000000..663844a6 --- /dev/null +++ b/vendor/symfony/routing/Symfony/Component/Routing/README.md | |||
@@ -0,0 +1,34 @@ | |||
1 | Routing Component | ||
2 | ================= | ||
3 | |||
4 | Routing associates a request with the code that will convert it to a response. | ||
5 | |||
6 | The example below demonstrates how you can set up a fully working routing | ||
7 | system: | ||
8 | |||
9 | use Symfony\Component\HttpFoundation\Request; | ||
10 | use Symfony\Component\Routing\Matcher\UrlMatcher; | ||
11 | use Symfony\Component\Routing\RequestContext; | ||
12 | use Symfony\Component\Routing\RouteCollection; | ||
13 | use Symfony\Component\Routing\Route; | ||
14 | |||
15 | $routes = new RouteCollection(); | ||
16 | $routes->add('hello', new Route('/hello', array('controller' => 'foo'))); | ||
17 | |||
18 | $context = new RequestContext(); | ||
19 | |||
20 | // this is optional and can be done without a Request instance | ||
21 | $context->fromRequest(Request::createFromGlobals()); | ||
22 | |||
23 | $matcher = new UrlMatcher($routes, $context); | ||
24 | |||
25 | $parameters = $matcher->match('/hello'); | ||
26 | |||
27 | Resources | ||
28 | --------- | ||
29 | |||
30 | You can run the unit tests with the following command: | ||
31 | |||
32 | $ cd path/to/Symfony/Component/Routing/ | ||
33 | $ composer.phar install --dev | ||
34 | $ phpunit | ||