interface BundleEntryReaderInterface implements BundleReaderInterface
Reads individual entries of a resource file.
mixed | read(string $path, string $locale) Reads a resource bundle. | from BundleReaderInterface |
mixed | readEntry(string $path, string $locale, array $indices, bool $fallback = true) Reads an entry from a resource bundle. |
Reads a resource bundle.
string | $path | The path to the resource bundle |
string | $locale | The locale to read |
mixed | returns an array or {@link \ArrayAccess} instance for complex data, a scalar value otherwise |
Reads an entry from a resource bundle.
An entry can be selected from the resource bundle by passing the path to that entry in the bundle. For example, if the bundle is structured like this:
TopLevel
NestedLevel
Entry: Value
Then the value can be read by calling:
$reader->readEntry('...', 'en', array('TopLevel', 'NestedLevel', 'Entry'));
string | $path | The path to the resource bundle |
string | $locale | The locale to read |
array | $indices | The indices to read from the bundle |
bool | $fallback | Whether to merge the value with the value from the fallback locale (e.g. "en" for "en_GB"). Only applicable if the result is multivalued (i.e. array or \ArrayAccess) or cannot be found in the requested locale. |
mixed | returns an array or {@link \ArrayAccess} instance for complex data and a scalar value for simple data |
MissingResourceException | If the indices cannot be accessed |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Intl/Data/Bundle/Reader/BundleEntryReaderInterface.html