svn: /phpdoc/ru/trunk/reference/classobj/functions/ call-user-method.xml
| From: | Shein Alexey | Date: | Mon, 07 Feb 2011 06:47:22 +0000 |
| Subject: | svn: /phpdoc/ru/trunk/reference/classobj/functions/ call-user-method.xml | ||
| Groups: | php.doc.ru | ||
| Request: | Send a blank email to doc-ru+get-1355@lists.php.net to get a copy of this message | ||
shein Mon, 07 Feb 2011 06:47:22 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=308080
Log:
Updated translation.
Changed paths:
U phpdoc/ru/trunk/reference/classobj/functions/call-user-method.xml
Modified: phpdoc/ru/trunk/reference/classobj/functions/call-user-method.xml
===================================================================
--- phpdoc/ru/trunk/reference/classobj/functions/call-user-method.xml 2011-02-07 06:42:26 UTC (rev
308079)
+++ phpdoc/ru/trunk/reference/classobj/functions/call-user-method.xml 2011-02-07 06:47:22 UTC (rev
308080)
@@ -1,77 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
+<!-- EN-Revision: 298514 Maintainer: shein Status: ready -->
+<!-- Reviewed: no -->
<!-- $Revision$ -->
-<!-- EN-Revision: n/a Maintainer: lovchy Status: ready -->
-<!-- splitted from ./en/functions/classobj.xml, last change in rev 1.4 -->
- <refentry xml:id="function.call-user-method" xmlns="http://docbook.org/ns/docbook">
- <refnamediv>
- <refname>call_user_method</refname>
- <refpurpose>
- Вызывает метод указанного объекта [устаревшее]
- </refpurpose>
- </refnamediv>
- <refsect1>
- <title>Описание</title>
- <methodsynopsis>
- <type>mixed</type><methodname>call_user_method</methodname>
-
<methodparam><type>string</type><parameter>method_name</parameter></methodparam>
-
<methodparam><type>object</type><parameter>obj</parameter></methodparam>
- <methodparam
choice="opt"><type>mixed</type><parameter>parameter</parameter></methodparam>
- <methodparam
choice="opt"><type>mixed</type><parameter>...</parameter></methodparam>
- </methodsynopsis>
- <warning>
- <para>
- Функция <function>call_user_method_array</function> устарела с
- выходом 4.1.0: используйте функцию
<function>call_user_func</function> с
- <literal>array(&$obj, "method_name")</literal> в
качестве параметра
- имени функции.
- </para>
- </warning>
- <para>
- Вызываем метод <parameter>method_name</parameter> объекта
<parameter>obj</parameter>.
- Ниже приведен пример использования функции, в
которой мы определяем
- класс, создаём его объект и используем
<function>call_user_method</function> для
- вызова метода <varname>print_info</varname>.
- </para>
- <para>
- <informalexample>
- <programlisting role="php">
+<refentry xml:id="function.call-user-method" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>call_user_method</refname>
+ <refpurpose>Вызывает метод указанного объекта
[устаревшее]</refpurpose>
+ </refnamediv>
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+ <type>mixed</type><methodname>call_user_method</methodname>
+
<methodparam><type>string</type><parameter>method_name</parameter></methodparam>
+ <methodparam><type>object</type><parameter
role="reference">obj</parameter></methodparam>
+ <methodparam
choice="opt"><type>mixed</type><parameter>parameter</parameter></methodparam>
+ <methodparam
choice="opt"><type>mixed</type><parameter>...</parameter></methodparam>
+ </methodsynopsis>
+ <warning>
+ <para>
+ Функция <function>call_user_method_array</function> устарела с
+ выходом 4.1.0.
+ </para>
+ </warning>
+ </refsect1>
+
+ <refsect1 role="parameters"><!-- {{{ -->
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>method_name</parameter></term>
+ <listitem>
+ <para>
+ Имя вызываемого метода.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>obj</parameter>
+ </term>
+ <listitem>
+ <para>
+ Объект (<type>object</type>), содержащий вызываемый
метод <parameter>method_name</parameter>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <parameter>parameter ...</parameter>
+ </term>
+ <listitem>
+ <para>
+ Необязательные параметры.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1><!-- }}} -->
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>Альтернатива
<function>call_user_method</function></title>
+ <programlisting role="php">
<![CDATA[
<?php
-class Country {
- var $NAME;
- var $TLD;
-
- function Country($name, $tld)
- {
- $this->NAME = $name;
- $this->TLD = $tld;
- }
-
- function print_info($prestr = "")
- {
- echo $prestr . "Country: " . $this->NAME . "\n";
- echo $prestr . "Top Level Domain: " . $this->TLD . "\n";
- }
-}
-
-$cntry = new Country("Peru", "pe");
-
-echo "* Calling the object method directly\n";
-$cntry->print_info();
-
-echo "\n* Calling the same method indirectly\n";
-call_user_method("print_info", $cntry, "\t");
+call_user_func(array($obj, $method_name), $parameter /* , ... */);
+call_user_func(array(&$obj, $method_name), $parameter /* , ... */); // PHP 4
?>
]]>
- </programlisting>
- </informalexample>
- </para>
- <simpara>
- См. также <function>call_user_func_array</function> и
- <function>call_user_func</function>.
- </simpara>
- </refsect1>
- </refentry>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>call_user_func_array</function></member>
+ <member><function>call_user_func</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+</refentry>
<!-- Keep this comment at the end of the file
Local variables:
@@ -84,7 +98,7 @@
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
-sgml-default-dtd-file:"../~/.phpdoc/manual.ced"
+sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil