Back to index

php5  5.3.10
Classes | Functions
msgfmt_api.php File Reference

Go to the source code of this file.

Classes

class  MessageFormatter
 Message formatter class. More...

Functions

 msgfmt_create ($locale, $pattern)
 Now the same as procedural API.
 msgfmt_format ($fmt, $args)
 Format the message.
 msgfmt_parse ($fmt, $value)
 parses input string and returns any extracted items as an array
 msgfmt_format_message ($locale, $pattern, $args)
 Inserts the items in $args into $pattern, formatting them according to $locale.
 msgfmt_parse_message ($locale, $value)
 parses input string and returns any extracted items as an array
 msgfmt_get_pattern ($fmt)
 Get the pattern used by the formatter.
 msgfmt_set_pattern ($fmt, $pattern)
 Set the pattern used by the formatter.
 msgfmt_get_error_code ($fmt)
 Get the error code from last operation.
 msgfmt_get_error_message ($fmt)
 Get the error text from the last operation.
 msgfmt_get_locale ($formatter)
 Get the locale for which the formatter was created.

Function Documentation

msgfmt_create ( locale,
pattern 
)

Now the same as procedural API.

Constructs a new Message Formatter

Parameters:
string$localethe locale to use when formatting arguments
string$patternthe pattern string to stick arguments into
Returns:
MessageFormatter formatter object

Definition at line 121 of file msgfmt_api.php.

{}

Here is the caller graph for this function:

msgfmt_format ( fmt,
args 
)

Format the message.

Parameters:
MessageFormatter$fmtThe message formatter
array$argsarguments to insert into the pattern string
Returns:
string the formatted string, or false if an error ocurred

Definition at line 129 of file msgfmt_api.php.

{}

Here is the caller graph for this function:

msgfmt_format_message ( locale,
pattern,
args 
)

Inserts the items in $args into $pattern, formatting them according to $locale.

This is the static implementation.

Parameters:
string$localethe locale to use when formatting numbers and dates and suchlike
string$patternthe pattern string to insert things into
array$argsthe array of values to insert into $pattern
Returns:
string the formatted pattern string or false if an error occured

Definition at line 153 of file msgfmt_api.php.

{}

Here is the caller graph for this function:

Get the error code from last operation.

Returns error code from the last number formatting operation.

Parameters:
MessageFormatter$fmtThe message formatter
Returns:
integer the error code, one of UErrorCode values. Initial value is U_ZERO_ERROR.

Definition at line 193 of file msgfmt_api.php.

{}

Here is the caller graph for this function:

Get the error text from the last operation.

Parameters:
MessageFormatter$fmtThe message formatter
Returns:
string Description of the last error.

Definition at line 200 of file msgfmt_api.php.

{}

Here is the caller graph for this function:

msgfmt_get_locale ( formatter)

Get the locale for which the formatter was created.

Parameters:
NumberFormatter$formatterThe formatter resource
Returns:
string locale name

Definition at line 208 of file msgfmt_api.php.

{}

Here is the caller graph for this function:

msgfmt_get_pattern ( fmt)

Get the pattern used by the formatter.

Parameters:
MessageFormatter$fmtThe message formatter
Returns:
string the pattern string for this message formatter

Definition at line 174 of file msgfmt_api.php.

{}

Here is the caller graph for this function:

msgfmt_parse ( fmt,
value 
)

parses input string and returns any extracted items as an array

$error will contain any error code. If an error occurs, $parse_pos contains the position of the error.

Parameters:
MessageFormatter$fmtThe message formatter
string$valuestring to parse for items
Returns:
array array containing items extracted

Definition at line 142 of file msgfmt_api.php.

{}

Here is the caller graph for this function:

msgfmt_parse_message ( locale,
value 
)

parses input string and returns any extracted items as an array

$error will contain any error code. If an error occurs, $parse_pos contains the position of the error.

Parameters:
string$localethe locale to use when formatting numbers and dates and suchlike
string$valuestring to parse for items
Returns:
array array containing items extracted

Definition at line 166 of file msgfmt_api.php.

{}

Here is the caller graph for this function:

msgfmt_set_pattern ( fmt,
pattern 
)

Set the pattern used by the formatter.

Parameters:
MessageFormatter$fmtThe message formatter
string$patternthe pattern string to use in this message formatter
Returns:
boolean 'true' if successful, 'false' if an error

Definition at line 183 of file msgfmt_api.php.

{}

Here is the caller graph for this function: