PHP Класс Noherczeg\Breadcrumb\Translator

The sole job of this class is to properly translate (or not) the given value according to the configurations.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( String $config = null ) Constructor
dump ( ) : array dump: Dumps the contents of the Dictionary.
loadDictionary ( String $lang = null ) : array loadDictionary: loads a language array from the Language folder.
loadFile ( String $file_to_load = null ) : array loadFile: yeah, well, separated due to testing purposes :(
translate ( String $key ) : String translate: Fetches a value from the Ditionary with an index provided.

Приватные методы

Метод Описание
initDictionary ( $config )

Описание методов

__construct() публичный метод

Constructor
public __construct ( String $config = null )
$config String The code(file name in the Languages folder), or an array of key-value pairs of the language to use for translations

dump() публичный метод

dump: Dumps the contents of the Dictionary.
public dump ( ) : array
Результат array

loadDictionary() публичный метод

loadDictionary: loads a language array from the Language folder.
public loadDictionary ( String $lang = null ) : array
$lang String Selected language's code e.g. 'en'
Результат array

loadFile() публичный метод

loadFile: yeah, well, separated due to testing purposes :(
public loadFile ( String $file_to_load = null ) : array
$file_to_load String Language file's name
Результат array

translate() публичный метод

translate: Fetches a value from the Ditionary with an index provided.
public translate ( String $key ) : String
$key String Parameter which we want to translate
Результат String