W3cubDocs

/Symfony 4.1

ArrayConverter

class ArrayConverter

ArrayConverter generates tree like structure from a message catalogue.

e.g. this 'foo.bar1' => 'test1', 'foo.bar2' => 'test2' converts to follows: foo: bar1: test1 bar2: test2.

Methods

static array expandToTree(array $messages)

Converts linear messages array to tree-like array.

Details

static array expandToTree(array $messages)

Converts linear messages array to tree-like array.

For example this rray('foo.bar' => 'value') will be converted to array('foo' => array('bar' => 'value')).

Parameters

array $messages Linear messages array

Return Value

array Tree-like messages array

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Translation/Util/ArrayConverter.html