Пример #1
0
 /**
  * @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);
     }
 }
Пример #2
0
 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));
     }
 }
Пример #3
0
 /**
  * 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;
     }
 }
Пример #4
0
 /**
  * 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'));
             }
         }
     }
 }
Пример #5
0
 public function __construct(ContainerInterface $container)
 {
     foreach ($container->findAnnotatedServiceIds('kernel.listener') as $id => $attributes) {
         $container->get($id)->register($this);
     }
 }