mirror of
https://github.com/php/doc-ru.git
synced 2026-04-23 15:28:24 +02:00
6d43fd64d7
[skip-spellcheck] [skip-lint]
139 lines
4.4 KiB
XML
139 lines
4.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 1976eae0d815797af97a1e16c5cd90ffc2868395 Maintainer: rjhdby Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="resourcebundle.get" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>ResourceBundle::get</refname>
|
|
<refname>resourcebundle_get</refname>
|
|
<refpurpose>Получить данные из пакета</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<para>
|
|
&style.oop;
|
|
</para>
|
|
<methodsynopsis role="ResourceBundle">
|
|
<modifier>public</modifier> <type>mixed</type><methodname>ResourceBundle::get</methodname>
|
|
<methodparam><type class="union"><type>string</type><type>int</type></type><parameter>index</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>fallback</parameter><initializer>&true;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
&style.procedural;
|
|
</para>
|
|
<methodsynopsis>
|
|
<type>mixed</type><methodname>resourcebundle_get</methodname>
|
|
<methodparam><type>ResourceBundle</type><parameter>bundle</parameter></methodparam>
|
|
<methodparam><type class="union"><type>string</type><type>int</type></type><parameter>index</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>fallback</parameter><initializer>&true;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Возвращает данные из пакета по индексу или строковому ключу.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>bundle</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Объект <classname>ResourceBundle</classname>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>index</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Индекс данных, должен быть строкой или целым числом.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>fallback</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Должна ли локаль совпадать точно, или можно откатиться к родительской локали.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Возвращает данные из пакета по индексу или строковому ключу или &null; в случае возникновения ошибки.
|
|
Строки, целые числа и бинарные строки возвращаются в соответствующем типе PHP,
|
|
массивы целых чисел возвращаются как массивы PHP. Сложные типы возвращаются как
|
|
объекты <classname>ResourceBundle</classname>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Пример использования <function>resourcebundle_get</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$r = resourcebundle_create( 'es', "/usr/share/data/myapp");
|
|
echo resourcebundle_get($r, 'somestring');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<example>
|
|
<title>Пример в объектно-ориентированном стиле</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$r = new ResourceBundle( 'es', "/usr/share/data/myapp");
|
|
echo $r->get('somestring');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
?Hola, mundo!
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>resourcebundle_count</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
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
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
|
|
-->
|