Elgg
Version 2.3
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
classes
Elgg
I18n
ArrayMessageBundle.php
Go to the documentation of this file.
1
<?php
2
namespace
Elgg\I18n
;
3
16
final
class
ArrayMessageBundle
implements
MessageBundle
{
17
19
private
$messages;
20
26
public
function
__construct
(array $messages) {
27
$this->
messages
= $messages;
28
}
29
31
public
function
get
(
$key
,
Locale
$locale) {
32
assert(is_string(
$key
),
'$key must be a string'
);
33
34
if
(!isset($this->
messages
[
"$locale"
]) || !is_array($this->
messages
[
"$locale"
])) {
35
return
null;
36
}
37
38
$messages = $this->
messages
[
"$locale"
];
39
if
(!is_string(
$key
) || !isset($messages[
$key
]) || !is_string($messages[$key])) {
40
return
null;
41
}
42
43
return
new
SprintfMessageTemplate
($messages[$key]);
44
}
45
}
messages
elgg page messages
Definition:
admin.css.php:233
Elgg\I18n\SprintfMessageTemplate
WARNING: API IN FLUX.
Definition:
SprintfMessageTemplate.php:13
Elgg\I18n\Locale
WARNING: API IN FLUX.
Definition:
Locale.php:13
$key
$key
Definition:
summary.php:34
Elgg\I18n\ArrayMessageBundle\__construct
__construct(array $messages)
Constructor.
Definition:
ArrayMessageBundle.php:26
Elgg\I18n
Definition:
ArrayMessageBundle.php:2
Elgg\I18n\MessageBundle
WARNING: API IN FLUX.
Definition:
MessageBundle.php:14
Elgg\I18n\ArrayMessageBundle
WARNING: API IN FLUX.
Definition:
ArrayMessageBundle.php:16
Generated on Sat Dec 21 2024 00:01:03 for Elgg by
1.8.11