1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
movim_ynh/sources/vendor/symfony/routing
2016-03-14 23:16:11 +01:00
..
Annotation update to movim upstream 2016-03-14 23:16:11 +01:00
Exception update to movim upstream 2016-03-14 23:16:11 +01:00
Generator update to movim upstream 2016-03-14 23:16:11 +01:00
Loader update to movim upstream 2016-03-14 23:16:11 +01:00
Matcher update to movim upstream 2016-03-14 23:16:11 +01:00
Tests update to movim upstream 2016-03-14 23:16:11 +01:00
.gitignore update to movim upstream 2016-03-14 23:16:11 +01:00
CHANGELOG.md update to movim upstream 2016-03-14 23:16:11 +01:00
CompiledRoute.php update to movim upstream 2016-03-14 23:16:11 +01:00
composer.json update to movim upstream 2016-03-14 23:16:11 +01:00
LICENSE update to movim upstream 2016-03-14 23:16:11 +01:00
phpunit.xml.dist update to movim upstream 2016-03-14 23:16:11 +01:00
README.md update to movim upstream 2016-03-14 23:16:11 +01:00
RequestContext.php update to movim upstream 2016-03-14 23:16:11 +01:00
RequestContextAwareInterface.php update to movim upstream 2016-03-14 23:16:11 +01:00
Route.php update to movim upstream 2016-03-14 23:16:11 +01:00
RouteCollection.php update to movim upstream 2016-03-14 23:16:11 +01:00
RouteCollectionBuilder.php update to movim upstream 2016-03-14 23:16:11 +01:00
RouteCompiler.php update to movim upstream 2016-03-14 23:16:11 +01:00
RouteCompilerInterface.php update to movim upstream 2016-03-14 23:16:11 +01:00
Router.php update to movim upstream 2016-03-14 23:16:11 +01:00
RouterInterface.php update to movim upstream 2016-03-14 23:16:11 +01:00

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 install
$ phpunit