Neos\Flow\I18n\Cldr\CldrModel::getElement PHP Méthode

getElement() public méthode

Path must point to leaf. Syntax for paths is same as for getRawData.
public getElement ( string $path ) : mixed
$path string A path to the element to get
Résultat mixed String with desired element, or FALSE on failure
    public function getElement($path)
    {
        $data = $this->getRawData($path);
        if (is_array($data)) {
            return false;
        } else {
            return $data;
        }
    }

Usage Example

 /**
  * @test
  */
 public function returnsElementCorrectly()
 {
     $result = $this->model->getElement('localeDisplayNames/localeDisplayPattern/localePattern');
     $this->assertEquals('{0} ({1})', $result);
     $result = $this->model->getElement('localeDisplayNames/variants');
     $this->assertEquals(false, $result);
 }