35774da863
* 2.3: [Security] fixed pre/post authentication checks Updated lithuanian validator translation: changed vartotojas to naudotojas as it is more proper term. Fixed CSS [HttpFoundation] Throw proper exception when invalid data is passed to JsonResponse class addressed == -> === suggestion Fixed #9020 - Added support for collections in service#parameters fixes PSR-0 issues in tests adjusted behavior to always copy override on url files Skips test that need full lib-intl. Conflicts: src/Symfony/Component/Security/Acl/Tests/Permission/MaskBuilderTest.php src/Symfony/Component/Security/Core/Tests/Authentication/Token/RememerMeTokenTest.php src/Symfony/Component/Security/Core/Tests/User/AccountCheckerTest.php src/Symfony/Component/Security/Core/Tests/User/InMemoryProviderTest.php src/Symfony/Component/Security/Http/Tests/Authentication/DefaultAuthenticationFailureHandlerTest.php src/Symfony/Component/Security/Http/Tests/Authentication/DefaultAuthenticationSuccessHandlerTest.php src/Symfony/Component/Security/Tests/Core/Authentication/Token/RememberMeTokenTest.php src/Symfony/Component/Security/Tests/Core/Authentication/Token/RememerMeTokenTest.php src/Symfony/Component/Security/Tests/Core/User/AccountCheckerTest.php src/Symfony/Component/Security/Tests/Core/User/InMemoryProviderTest.php src/Symfony/Component/Security/Tests/Core/User/InMemoryUserProviderTest.php src/Symfony/Component/Security/Tests/Core/User/UserCheckerTest.php |
||
---|---|---|
.. | ||
Annotation | ||
Exception | ||
Generator | ||
Loader | ||
Matcher | ||
Tests | ||
.gitignore | ||
CHANGELOG.md | ||
CompiledRoute.php | ||
composer.json | ||
LICENSE | ||
phpunit.xml.dist | ||
README.md | ||
RequestContext.php | ||
RequestContextAwareInterface.php | ||
Route.php | ||
RouteCollection.php | ||
RouteCompiler.php | ||
RouteCompilerInterface.php | ||
Router.php | ||
RouterInterface.php |
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