Class

Symfony\Component\Config\Loader\LoaderResolver

class LoaderResolver implements LoaderResolverInterface

LoaderResolver selects a loader for a given resource.

A resource can be anything (e.g. a full path to a config file or a Closure). Each loader determines whether it can load a resource and how.

Methods

__construct(array $loaders = array())

Constructor.

LoaderInterface|false resolve(mixed $resource, string $type = null)

Returns a loader able to load the resource.

addLoader(LoaderInterface $loader)

Adds a loader.

LoaderInterface[] getLoaders()

Returns the registered loaders.

Details

at line 34
public __construct(array $loaders = array())

Constructor.

Parameters

array $loaders An array of loaders

at line 49
public LoaderInterface|false resolve(mixed $resource, string $type = null)

Returns a loader able to load the resource.

Parameters

mixed $resource A resource
string $type The resource type

Return Value

LoaderInterface|false A LoaderInterface instance

at line 65
public addLoader(LoaderInterface $loader)

Adds a loader.

Parameters

LoaderInterface $loader A LoaderInterface instance

at line 76
public LoaderInterface[] getLoaders()

Returns the registered loaders.

Return Value

LoaderInterface[] An array of LoaderInterface instances