Legend of the Green Dragon

Yaml extends AbstractFileLoader implements FileLoaderInterface

Load a Yaml file.

Interfaces, Classes and Traits

FileLoaderInterface

Table of Contents

load()  : mixed
{@inheritdoc}
flatten()  : mixed
Flattens an nested yaml of translations.

Methods

load()

{@inheritdoc}

public load(mixed $locale, mixed $filename) : mixed
Parameters
$locale : mixed
$filename : mixed
Return values
mixed

flatten()

Flattens an nested yaml of translations.

private flatten(array<string|int, mixed> $messages[, array<string|int, mixed> $node = null ][, string $path = null ]) : mixed

The scheme used is: 'key': 'key2': 'key3': 'value' 'key4': - 'value1' - 'value2' 'key5': 0: 'value3' 1: 'value4' 'key6': '0': 'value5' '1': 'value6' 'key7': '00': 'value7' '01': 'value8'

Becomes: [ 'key.key2.key3' => 'value', 'key.key4' => [ 0 => 'value1', 1 => 'value2' ], 'key.key5' => [ 0 => 'value3', 1 => 'value4' ], 'key.key6' => [ 0 => 'value5', 1 => 'value6' ], 'key.key7.00' => 'value7', 'key.key7.01' => 'value8', ]

Parameters
$messages : array<string|int, mixed>
$node : array<string|int, mixed> = null

Internal use

$path : string = null

Internal use

Tags
TODO

In PHP 7.3.0 Use array_key_first() to avoid use of reset() and key()

Return values
mixed

Search results