2007-12-26 20:43:37 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 07:47:57 +00:00
|
|
|
<!-- $Revision$ -->
|
2021-09-05 11:39:38 +00:00
|
|
|
<refentry xml:id="messageformatter.geterrormessage" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
2007-12-26 20:43:37 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>MessageFormatter::getErrorMessage</refname>
|
|
|
|
<refname>msgfmt_get_error_message</refname>
|
|
|
|
<refpurpose>Get the error text from the last operation</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
|
|
|
<para>
|
2012-01-11 06:50:17 +00:00
|
|
|
&style.oop;
|
2007-12-26 20:43:37 +00:00
|
|
|
</para>
|
2021-09-05 11:39:38 +00:00
|
|
|
<methodsynopsis role="oop">
|
|
|
|
<modifier>public</modifier> <type>string</type><methodname>MessageFormatter::getErrorMessage</methodname>
|
|
|
|
<void/>
|
2008-01-27 19:48:18 +00:00
|
|
|
</methodsynopsis>
|
2007-12-26 20:43:37 +00:00
|
|
|
<para>
|
2012-01-11 06:50:17 +00:00
|
|
|
&style.procedural;
|
2007-12-26 20:43:37 +00:00
|
|
|
</para>
|
2021-09-05 11:39:38 +00:00
|
|
|
<methodsynopsis role="procedural">
|
|
|
|
<type>string</type><methodname>msgfmt_get_error_message</methodname>
|
|
|
|
<methodparam><type>MessageFormatter</type><parameter>formatter</parameter></methodparam>
|
2007-12-26 20:43:37 +00:00
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
Get the error text from the last operation.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2021-09-05 11:39:38 +00:00
|
|
|
<term><parameter>formatter</parameter></term>
|
2007-12-26 20:43:37 +00:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The message formatter
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
Description of the last error.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<example>
|
|
|
|
<title><function>msgfmt_get_error_message</function> example</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$fmt = msgfmt_create("en_US", "{0, number} monkeys on {1, number} trees");
|
|
|
|
$str = msgfmt_format($fmt, array());
|
|
|
|
if(!$str) {
|
|
|
|
echo "ERROR: ".msgfmt_get_error_message($fmt) . " (" . msgfmt_get_error_code($fmt) . ")\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
<example>
|
|
|
|
<title>OO example</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$fmt = new MessageFormatter("en_US", "{0, number} monkeys on {1, number} trees");
|
|
|
|
$str = $fmt->format(array());
|
|
|
|
if(!$str) {
|
|
|
|
echo "ERROR: ".$fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
&example.outputs;
|
|
|
|
<screen>
|
|
|
|
<![CDATA[
|
|
|
|
ERROR: msgfmt_format: not enough parameters: U_ILLEGAL_ARGUMENT_ERROR (1)
|
|
|
|
]]>
|
|
|
|
</screen>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
|
|
|
<member><function>msgfmt_get_error_code</function></member>
|
|
|
|
<member><function>intl_get_error_code</function></member>
|
|
|
|
<member><function>intl_is_failure</function></member>
|
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2007-12-26 20:43:37 +00:00
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|