1<?php
2
3/*
4 * This file is part of the Silex framework.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Silex\Provider;
13
14use Silex\Application;
15use Silex\ServiceProviderInterface;
16use Symfony\Component\Routing\Generator\UrlGenerator;
17
18/**
19 * Symfony Routing component Provider for URL generation.
20 *
21 * @author Fabien Potencier <fabien@symfony.com>
22 */
23class UrlGeneratorServiceProvider implements ServiceProviderInterface
24{
25    public function register(Application $app)
26    {
27        $app['url_generator'] = $app->share(function ($app) {
28            $app->flush();
29
30            return new UrlGenerator($app['routes'], $app['request_context']);
31        });
32    }
33
34    public function boot(Application $app)
35    {
36    }
37}
38