PHP Class common\Language

This is useful for when you want to use the same code in the Back- and Frontend. For instance in a trait.
Inheritance: extends Symfony\Component\Translation\IdentityTranslator
Show file Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
act ( $key ) : string Get an action.
callLanguageFunction ( $function, $parameters = [] ) : mixed
err ( $key ) : string Get an error.
get ( ) : string
lbl ( $key ) : string Get a label.
msg ( $key ) : string Get a message.
trans ( $id, array $parameters = [], $domain = null, $locale = null )

Method Details

act() public static method

Get an action.
public static act ( $key ) : string
$key
return string

callLanguageFunction() public static method

public static callLanguageFunction ( $function, $parameters = [] ) : mixed
$function
$parameters
return mixed

err() public static method

This only implements the key because the other parameters differ between the front- and backend.
public static err ( $key ) : string
$key
return string

get() public static method

public static get ( ) : string
return string

lbl() public static method

This only implements the key because the other parameters differ between the front- and backend.
public static lbl ( $key ) : string
$key
return string

msg() public static method

This only implements the key because the other parameters differ between the front- and backend.
public static msg ( $key ) : string
$key
return string

trans() public method

public trans ( $id, array $parameters = [], $domain = null, $locale = null )
$parameters array