Cecil

Language

Language renderer class.

This class is responsible for managing language properties such as name, locale, and weight. It retrieves these properties from the configuration object and provides methods to access them. It also ensures that the properties exist and are not empty, throwing an exception if they are.

Table of Contents

Properties

$config  : Config
Configuration object.
$language  : string
Current language code.

Methods

__construct()  : mixed
__toString()  : string
Returns the current language.
getLocale()  : string|null
Returns the locale of the current or of the given language code.
getName()  : string|null
Returns the name of the current or of the given language code.
getWeight()  : int
Returns the weight of the current or of the given language code.
hasProperty()  : bool
Checks if the given property exists for the current language.

Properties

$language

Current language code.

protected string $language

Methods

__construct()

public __construct(Config $config[, string|null $language = null ]) : mixed
Parameters
$config : Config
$language : string|null = null

__toString()

Returns the current language.

public __toString() : string
Return values
string

getLocale()

Returns the locale of the current or of the given language code.

public getLocale([string|null $language = null ]) : string|null
Parameters
$language : string|null = null
Return values
string|null

getName()

Returns the name of the current or of the given language code.

public getName([string|null $language = null ]) : string|null
Parameters
$language : string|null = null
Return values
string|null

getWeight()

Returns the weight of the current or of the given language code.

public getWeight([string|null $language = null ]) : int
Parameters
$language : string|null = null
Return values
int

hasProperty()

Checks if the given property exists for the current language.

private hasProperty(string $property) : bool
Parameters
$property : string
Return values
bool
 
On this page

Search results