PHP Класс lithium\g11n\catalog\adapter\Php

An example PHP file must contain a return statement which returns an array if the the file is included. {{{ '\d+', 'phone' => '\d+\-\d+' ); ?> }}} The adapter works with a directory structure below. The example shows the structure for the directory as given by the 'path' configuration setting. It is similar to the one used by the the Gettext adapter. {{{ resources/g11n/php ├── | ├── message | | ├── default.php | | └── .php | ├── validation | | └── ... | └── ... ├── | └── ... ├── message_default.php ├── message_.php ├── validation_default.php ├── validation_.php └── ... }}}
См. также: lithium\g11n\catalog\adapter\Gettext
Наследование: extends lithium\g11n\catalog\Adapter
Показать файл Открыть проект

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

Метод Описание
__construct ( array $config = [] ) : void Constructor.
read ( string $category, string $locale, string $scope ) : array Reads data.

Защищенные методы

Метод Описание
_file ( string $category, string $locale, string $scope ) : string Helper method for transforming a category, locale and scope into a filename.
_init ( ) : void Initializer. Checks if the configured path exists.

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

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

Constructor.
public __construct ( array $config = [] ) : void
$config array Available configuration options are: - `'path'`: The path to the directory holding the data.
Результат void

_file() защищенный Метод

Helper method for transforming a category, locale and scope into a filename.
protected _file ( string $category, string $locale, string $scope ) : string
$category string Category name.
$locale string Locale identifier.
$scope string Current operation scope.
Результат string Filename.

_init() защищенный Метод

Initializer. Checks if the configured path exists.
protected _init ( ) : void
Результат void

read() публичный Метод

Reads data.
public read ( string $category, string $locale, string $scope ) : array
$category string A category.
$locale string A locale identifier.
$scope string The scope for the current operation.
Результат array