4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Routing\Loader\DependencyInjection;
14 use Psr\Container\ContainerInterface;
15 use Symfony\Component\Routing\Loader\ObjectRouteLoader;
18 * A route loader that executes a service to load the routes.
20 * This depends on the DependencyInjection component.
22 * @author Ryan Weaver <ryan@knpuniversity.com>
24 class ServiceRouterLoader extends ObjectRouteLoader
27 * @var ContainerInterface
31 public function __construct(ContainerInterface $container)
33 $this->container = $container;
36 protected function getServiceObject($id)
38 return $this->container->get($id);