Symfony2 API
Class

Symfony\Component\Routing\Loader\AnnotationFileLoader

class AnnotationFileLoader extends FileLoader

AnnotationFileLoader loads routing information from annotations set on a PHP class and its methods.

Methods

__construct(FileLocatorInterface $locator, AnnotationClassLoader $loader, string|array $paths = array())

Constructor.

setCurrentDir($dir)

from FileLoader
getLocator()

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

Imports a resource.

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

Loads from annotations from a file.

supports($resource, $type = null)

{@inheritdoc}

Details

at line 38
public __construct(FileLocatorInterface $locator, AnnotationClassLoader $loader, string|array $paths = array())

Constructor.

Parameters

FileLocatorInterface $locator A FileLocator instance
AnnotationClassLoader $loader An AnnotationClassLoader instance
string|array $paths A path or an array of paths where to look for resources

in FileLoader at line 41
public setCurrentDir($dir)

Parameters

$dir

in FileLoader at line 46
public getLocator()

in FileLoader at line 64
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

at line 59
public RouteCollection load(string $file, string|null $type = null)

Loads from annotations from a file.

Parameters

string $file A PHP file path
string|null $type The resource type

Return Value

RouteCollection A RouteCollection instance

Exceptions

InvalidArgumentException When the file does not exist or its routes cannot be parsed

at line 75
public supports($resource, $type = null)

{@inheritdoc}

Parameters

$resource
$type