Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

[READ-ONLY] Subtree split of the Symfony Routing Component -- clone into Symfony/Component/ (master at symfony/symfony)

Merge branch '2.4'

* 2.4:
  unified return null usages
  [Validator] added Japanese translation
  Textarea value should default to empty string instead of null.
  Fix doc blocks
  [Process] Fix #10681, process are failing on Windows Server 2003
  updated doc
  [Security] fix DBAL connection typehint
  [HttpFoundation] status 201 is allowed to have a body
  unified return null usages

Conflicts:
	src/Symfony/Component/DependencyInjection/ContainerBuilder.php
	src/Symfony/Component/DomCrawler/Crawler.php
	src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php
latest commit a64686e428
Fabien Potencier fabpot authored April 18, 2014
Octocat-spinner-32 Annotation unify constructor initialization style throughout symfony November 11, 2013
Octocat-spinner-32 Exception corrected English grammar (s/does not exists/does not exist) August 13, 2013
Octocat-spinner-32 Generator Merge branch '2.4' April 18, 2014
Octocat-spinner-32 Loader Merge branch '2.4' April 16, 2014
Octocat-spinner-32 Matcher Merge branch '2.4' April 16, 2014
Octocat-spinner-32 Tests Merge branch '2.4' April 16, 2014
Octocat-spinner-32 .gitignore Added missing files .gitignore July 21, 2013
Octocat-spinner-32 CHANGELOG.md [Routing][FrameworkBundle] Deprecated the apache dumper January 13, 2014
Octocat-spinner-32 CompiledRoute.php renamed hostname to host in the routing system (closes #6775) January 21, 2013
Octocat-spinner-32 LICENSE update year on licenses January 07, 2014
Octocat-spinner-32 README.md updated the composer install command to reflect changes in Composer September 18, 2013
Octocat-spinner-32 RequestContext.php fixed types in phpdocs April 16, 2014
Octocat-spinner-32 RequestContextAwareInterface.php fixed CS July 09, 2012
Octocat-spinner-32 Route.php fixed types in phpdocs April 16, 2014
Octocat-spinner-32 RouteCollection.php [Routing] added support for expression conditions in routes September 19, 2013
Octocat-spinner-32 RouteCompiler.php made {@inheritdoc} annotations consistent across the board April 16, 2014
Octocat-spinner-32 RouteCompilerInterface.php renamed hostname to host in the routing system (closes #6775) January 21, 2013
Octocat-spinner-32 Router.php minor #9487 unify constructor initialization style throughout symfony… November 22, 2013
Octocat-spinner-32 RouterInterface.php fixed CS July 09, 2012
Octocat-spinner-32 composer.json updated version to 2.5 November 24, 2013
Octocat-spinner-32 phpunit.xml.dist made usage of Composer autoloader for subtree-split unit tests November 09, 2012
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
$ phpunit
Something went wrong with that request. Please try again.