YamlFileLoader
extends FileLoader
in package
Uses
HostTrait, LocalizedRouteTrait, PrefixTrait
YamlFileLoader loads Yaml routing files.
Tags
Table of Contents
Constants
- AVAILABLE_KEYS = ['resource', 'type', 'prefix', 'path', 'host', 'schemes', 'methods', 'defaults', 'requirements', 'options', 'condition', 'controller', 'name_prefix', 'trailing_slash_on_root', 'locale', 'format', 'utf8', 'exclude', 'stateless']
Properties
- $env : mixed
- $loading : mixed
- $locator : mixed
- $resolver : mixed
- $currentDir : string|null
- $yamlParser : mixed
Methods
- __construct() : mixed
- getLocator() : FileLocatorInterface
- Returns the file locator used by this loader.
- getResolver() : LoaderResolverInterface
- Gets the loader resolver.
- import() : mixed
- Imports a resource.
- load() : RouteCollection
- resolve() : LoaderInterface
- Finds a loader able to load an imported resource.
- setCurrentDir() : mixed
- Sets the current directory.
- setResolver() : mixed
- Sets the loader resolver.
- supports() : bool
- {@inheritdoc}
- parseImport() : mixed
- Parses an import and adds the routes in the resource to the RouteCollection.
- parseRoute() : mixed
- Parses a route and adds it to the RouteCollection.
- validate() : mixed
- doImport() : mixed
- validateAlias() : void
Constants
AVAILABLE_KEYS
private
mixed
AVAILABLE_KEYS
= ['resource', 'type', 'prefix', 'path', 'host', 'schemes', 'methods', 'defaults', 'requirements', 'options', 'condition', 'controller', 'name_prefix', 'trailing_slash_on_root', 'locale', 'format', 'utf8', 'exclude', 'stateless']
Properties
$env
protected
mixed
$env
$loading
protected
static mixed
$loading
= []
$locator
protected
mixed
$locator
$resolver
protected
mixed
$resolver
$currentDir
private
string|null
$currentDir
= null
$yamlParser
private
mixed
$yamlParser
Methods
__construct()
public
__construct([string $env = null ]) : mixed
Parameters
- $env : string = null
getLocator()
Returns the file locator used by this loader.
public
getLocator() : FileLocatorInterface
Return values
FileLocatorInterfacegetResolver()
Gets the loader resolver.
public
getResolver() : LoaderResolverInterface
Return values
LoaderResolverInterfaceimport()
Imports a resource.
public
import(mixed $resource[, string $type = null ]) : mixed
Parameters
- $resource : mixed
- $type : string = null
load()
public
load(mixed $file[, string $type = null ]) : RouteCollection
Parameters
- $file : mixed
- $type : string = null
Tags
Return values
RouteCollectionresolve()
Finds a loader able to load an imported resource.
public
resolve(mixed $resource[, string $type = null ]) : LoaderInterface
Parameters
- $resource : mixed
- $type : string = null
Tags
Return values
LoaderInterfacesetCurrentDir()
Sets the current directory.
public
setCurrentDir(string $dir) : mixed
Parameters
- $dir : string
setResolver()
Sets the loader resolver.
public
setResolver(LoaderResolverInterface $resolver) : mixed
Parameters
- $resolver : LoaderResolverInterface
supports()
{@inheritdoc}
public
supports(mixed $resource[, string $type = null ]) : bool
Parameters
- $resource : mixed
- $type : string = null
Return values
boolparseImport()
Parses an import and adds the routes in the resource to the RouteCollection.
protected
parseImport(RouteCollection $collection, array<string|int, mixed> $config, string $path, string $file) : mixed
Parameters
- $collection : RouteCollection
- $config : array<string|int, mixed>
- $path : string
- $file : string
parseRoute()
Parses a route and adds it to the RouteCollection.
protected
parseRoute(RouteCollection $collection, string $name, array<string|int, mixed> $config, string $path) : mixed
Parameters
- $collection : RouteCollection
- $name : string
- $config : array<string|int, mixed>
- $path : string
validate()
protected
validate(mixed $config, string $name, string $path) : mixed
Parameters
- $config : mixed
- $name : string
- $path : string
Tags
doImport()
private
doImport(mixed $resource[, string $type = null ][, bool $ignoreErrors = false ][, string $sourceResource = null ]) : mixed
Parameters
- $resource : mixed
- $type : string = null
- $ignoreErrors : bool = false
- $sourceResource : string = null
validateAlias()
private
validateAlias(array<string|int, mixed> $config, string $name, string $path) : void
Parameters
- $config : array<string|int, mixed>
- $name : string
- $path : string