StructuredBundleReaderInterface

interface StructuredBundleReaderInterface implements BundleReaderInterface Reads individual entries of a resource file. Methods mixed read(string $path, string $locale) Reads a resource bundle. from BundleReaderInterface string[] getLocales(string $path) Reads the available locales of a resource bundle. from BundleReaderInterface mixed readEntry(string $path, string $locale, array $indices, Boolean $fallback = true) Reads an entry from a resource bundle. Details

StructuredBundleReader::readEntry()

mixed readEntry(string $path, string $locale, array $indices, Boolean $fallback = true) 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')); Parameters string $path The path to th

StructuredBundleReader::read()

mixed read(string $path, string $locale) Reads a resource bundle. Parameters string $path The path to the resource bundle. string $locale The locale to read. Return Value mixed Returns an array or {@link \ArrayAccess} instance for complex data, a scalar value otherwise.

StructuredBundleReader::getLocales()

string[] getLocales(string $path) Reads the available locales of a resource bundle. Parameters string $path The path to the resource bundle. Return Value string[] A list of supported locale codes.

StructuredBundleReader

class StructuredBundleReader implements StructuredBundleReaderInterface A structured reader wrapping an existing resource bundle reader. Methods __construct(BundleReaderInterface $reader) Creates an entry reader based on the given resource bundle reader. mixed read(string $path, string $locale) Reads a resource bundle. string[] getLocales(string $path) Reads the available locales of a resource bundle. mixed readEntry(string $path, string $locale, array $indices, Boolean $f

StringUtils deprecated::safeStrlen()

static int safeStrlen(string $string) Returns the number of bytes in a string. Parameters string $string The string whose length we wish to obtain Return Value int

StringUtils deprecated::equals()

static bool equals(string $knownString, string $userInput) Compares two strings. This method implements a constant-time algorithm to compare strings. Regardless of the used implementation, it will leak length information. Parameters string $knownString The string of known length to compare against string $userInput The string that the user can control Return Value bool true if the two strings are the same, false otherwise

StringUtils deprecated

class StringUtils deprecated since 2.8, to be removed in 3.0. String utility functions. Methods static bool equals(string $knownString, string $userInput) Compares two strings. static int safeStrlen(string $string) Returns the number of bytes in a string. Details static bool equals(string $knownString, string $userInput) Compares two strings. This method implements a constant-time algorithm to compare strings. Regardless of the used imp

StringUtil::trim()

static string trim(string $string) Returns the trimmed data. Parameters string $string Return Value string

StringUtil::fqcnToBlockPrefix()

static string|null fqcnToBlockPrefix(string $fqcn) Converts a fully-qualified class name to a block prefix. Parameters string $fqcn The fully-qualified class name Return Value string|null The block prefix or null if not a valid FQCN