PHP Class 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 └── ... }}}
See also: lithium\g11n\catalog\adapter\Gettext
Inheritance: extends lithium\g11n\catalog\Adapter
ファイルを表示 Open project: unionofrad/lithium

Public Methods

Method Description
__construct ( array $config = [] ) : void Constructor.
read ( string $category, string $locale, string $scope ) : array Reads data.

Protected Methods

Method Description
_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.

Method Details

__construct() public method

Constructor.
public __construct ( array $config = [] ) : void
$config array Available configuration options are: - `'path'`: The path to the directory holding the data.
return void

_file() protected method

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.
return string Filename.

_init() protected method

Initializer. Checks if the configured path exists.
protected _init ( ) : void
return void

read() public method

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.
return array