Class

Symfony\Component\Routing\Loader\PhpFileLoader

class PhpFileLoader extends FileLoader

PhpFileLoader loads routes from a PHP file.

The file must return a RouteCollection instance.

Methods

LoaderResolver getResolver()

Gets the loader resolver.

from Loader
setResolver(LoaderResolver $resolver)

Sets the loader resolver.

from Loader
mixed import(mixed $resource, string $type = null, Boolean $ignoreErrors = false, string $sourceResource = null)

Imports a resource.

from FileLoader
LoaderInterface resolve(mixed $resource, string $type = null)

Finds a loader able to load an imported resource.

from Loader
__construct(FileLocatorInterface $locator)

Constructor.

from FileLoader
setCurrentDir($dir)

from FileLoader
getLocator()

from FileLoader
load(mixed $file, string $type = null)

Loads a PHP file.

Boolean supports(mixed $resource, string $type = null)

Returns true if this class supports the given resource.

Details

in Loader at line 30
public LoaderResolver getResolver()

Gets the loader resolver.

Return Value

LoaderResolver A LoaderResolver instance

in Loader at line 40
public setResolver(LoaderResolver $resolver)

Sets the loader resolver.

Parameters

LoaderResolver $resolver A LoaderResolver instance

in FileLoader at line 61
public mixed import(mixed $resource, string $type = null, Boolean $ignoreErrors = false, string $sourceResource = null)

Imports a resource.

Parameters

mixed $resource A Resource
string $type The resource type
Boolean $ignoreErrors Whether to ignore import errors or not
string $sourceResource The original resource importing the new resource

Return Value

mixed

in Loader at line 68
public LoaderInterface resolve(mixed $resource, string $type = null)

Finds a loader able to load an imported resource.

Parameters

mixed $resource A Resource
string $type The resource type

Return Value

LoaderInterface A LoaderInterface instance

Exceptions

FileLoaderLoadException if no loader is found

in FileLoader at line 36
public __construct(FileLocatorInterface $locator)

Constructor.

Parameters

FileLocatorInterface $locator A FileLocatorInterface instance

in FileLoader at line 41
public setCurrentDir($dir)

Parameters

$dir

in FileLoader at line 46
public getLocator()

at line 36
public load(mixed $file, string $type = null)

Loads a PHP file.

Parameters

mixed $file A PHP file path
string $type The resource type

at line 60
public Boolean supports(mixed $resource, string $type = null)

Returns true if this class supports the given resource.

Parameters

mixed $resource A resource
string $type The resource type

Return Value

Boolean True if this class supports the given resource, false otherwise