Documentation

YamlFileLoader extends FileLoader
in package
Uses HostTrait, LocalizedRouteTrait, PrefixTrait

YamlFileLoader loads Yaml routing files.

Tags
author

Fabien Potencier fabien@symfony.com

author

Tobias Schultze http://tobion.de

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

$resolver

protected mixed $resolver

$currentDir

private string|null $currentDir = null

Methods

__construct()

public __construct([string $env = null ]) : mixed
Parameters
$env : string = null

import()

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
throws
InvalidArgumentException

When a route can't be parsed because YAML is invalid

Return values
RouteCollection

setCurrentDir()

Sets the current directory.

public setCurrentDir(string $dir) : mixed
Parameters
$dir : string

supports()

{@inheritdoc}

public supports(mixed $resource[, string $type = null ]) : bool
Parameters
$resource : mixed
$type : string = null
Return values
bool

parseImport()

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
throws
InvalidArgumentException

If one of the provided config keys is not supported, something is missing or the combination is nonsense

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
Tags
throws
InvalidArgumentException

If one of the provided config keys is not supported, something is missing or the combination is nonsense


        
On this page

Search results