/** * @param Symfony\Components\DependencyInjection\ContainerInterface $container */ public function __construct(ContainerInterface $container) { foreach ($container->findAnnotatedServiceIds('server.request_handler') as $id => $attributes) { $container->getService($id)->register($this); } foreach ($container->findAnnotatedServiceIds('server.response_filter') as $id => $attributes) { $container->getService($id)->register($this); } }
public function __construct(ContainerInterface $container, \Twig_LoaderInterface $loader = null, $options = array()) { parent::__construct($loader, $options); foreach ($container->findAnnotatedServiceIds('twig.extension') as $id => $attributes) { $this->addExtension($container->get($id)); } }
/** * Constructor. * * @param \Symfony\Components\DependencyInjection\ContainerInterface $container A ContainerInterface instance * @param \Symfony\Components\Routing\Loader\LoaderInterface[] $loaders An array of loaders */ public function __construct(ContainerInterface $container, array $loaders = array()) { parent::__construct($loaders); $this->container = $container; foreach ($container->findAnnotatedServiceIds('routing.loader') as $id => $attributes) { $this->services[] = $id; } }
/** * Constructor. * */ public function __construct(ContainerInterface $container) { $this->container = $container; foreach ($container->findAnnotatedServiceIds('kernel.listener') as $id => $attributes) { foreach ($attributes as $attribute) { if (isset($attribute['event'])) { $this->connect($attribute['event'], array($id, isset($attribute['method']) ? $attribute['method'] : 'handle')); } } } }
public function __construct(ContainerInterface $container) { foreach ($container->findAnnotatedServiceIds('kernel.listener') as $id => $attributes) { $container->get($id)->register($this); } }