Symfony\Component\Routing\Router::__construct PHP Method

__construct() public method

Constructor.
public __construct ( Symfony\Component\Config\Loader\LoaderInterface $loader, mixed $resource, array $options = [], Symfony\Component\Routing\RequestContext $context = null, array $defaults = [] )
$loader Symfony\Component\Config\Loader\LoaderInterface A LoaderInterface instance
$resource mixed The main resource to load
$options array An array of options
$context Symfony\Component\Routing\RequestContext The context
$defaults array The default values
    public function __construct(LoaderInterface $loader, $resource, array $options = array(), RequestContext $context = null, array $defaults = array())
    {
        $this->loader = $loader;
        $this->resource = $resource;
        $this->context = null === $context ? new RequestContext() : $context;
        $this->defaults = $defaults;
        $this->setOptions($options);
    }

Usage Example

Ejemplo n.º 1
0
 public function __construct(RouteCollection $routes, LoaderInterface $loader, $resource, array $options = array(), RequestContext $context = null, LoggerInterface $logger = null)
 {
     parent::__construct($loader, $resource, $options, $context, $logger);
     $this->appendCollection = $routes;
 }