★ wanayoo — archive 1999 https://github.com/symfony/RoutingNouvelle recherche | Portail wanayoo
Github
This repository
This repository
All repositories

Merge branch '2.2' …

* 2.2:
  fixed CS
  Fixed XML syntax.
  Fixed parsing of leading blank lines in folded scalars. Closes #7989.
  [Form] Fixed a method name.
  Added a test case for Loader::import().
  Fixed Loader import
  [Console] Added dedicated testcase for HelperSet class
  [Serializer] fixed CS (refs #7971)
  Fixed fatal error in normalize/denormalizeObject.
  Fixed 2 namespaces

Conflicts:
	src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php
	src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php
latest commit a35b6397d4
fabpot authored
Annotation renamed hostname to host in the routing system (closes #6775) []
Exception [Routing] added more phpdoc and replaced 'array of type' by 'Type[]' []
Generator [CS Fix] Consistent coding-style of concatenation operator usage []
Loader made some optimization when parsing YAML files []
Matcher [Routing] fixed previous merge []
Tests Merge branch '2.2' []
.gitignore made usage of Composer autoloader for subtree-split unit tests []
CHANGELOG.md added missing entries in CHANGELOGs []
CompiledRoute.php renamed hostname to host in the routing system (closes #6775) []
LICENSE updated license year []
README.md made usage of Composer autoloader for subtree-split unit tests []
RequestContext.php [2.3] [Routing] Added access to querystring in RequestContext []
RequestContextAwareInterface.php fixed CS []
Route.php Fixed typos []
RouteCollection.php [CS Fix] Consistent coding-style of concatenation operator usage []
RouteCompiler.php Merge branch '2.1' into 2.2 []
RouteCompilerInterface.php renamed hostname to host in the routing system (closes #6775) []
Router.php merged branch Seldaek/psr3 (PR #6628) []
RouterInterface.php fixed CS []
composer.json Merge branch '2.2' []
phpunit.xml.dist made usage of Composer autoloader for subtree-split unit tests []
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:

$ cd path/to/Symfony/Component/Routing/
$ composer.phar install --dev
$ phpunit


Something went wrong with that request. Please try again.