Symfony\Component\Routing\Loader\LoaderResolver::__construct PHP Method

__construct() public method

Constructor.
public __construct ( array $loaders = [] )
$loaders array An array of loaders
    public function __construct(array $loaders = array())
    {
        $this->loaders = array();
        foreach ($loaders as $loader) {
            $this->addLoader($loader);
        }
    }

Usage Example

Example #1
0
 /**
  * Constructor.
  *
  * @param ContainerInterface $container A ContainerInterface instance
  * @param LoaderInterface[]  $loaders An array of loaders
  */
 public function __construct(ContainerInterface $container, array $loaders = array())
 {
     parent::__construct($loaders);
     $this->container = $container;
     foreach ($container->findTaggedServiceIds('routing.loader') as $id => $attributes) {
         $this->services[] = $id;
     }
 }