You are here

private static function ArrayConverter::cancelExpand in Plug 7

1 call to ArrayConverter::cancelExpand()
ArrayConverter::getElementByPath in lib/Symfony/translation/Util/ArrayConverter.php

File

lib/Symfony/translation/Util/ArrayConverter.php, line 87

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.

Namespace

Symfony\Component\Translation\Util

Code

private static function cancelExpand(array &$tree, $prefix, array $node) {
  $prefix .= '.';
  foreach ($node as $id => $value) {
    if (is_string($value)) {
      $tree[$prefix . $id] = $value;
    }
    else {
      self::cancelExpand($tree, $prefix . $id, $value);
    }
  }
}