[PHP-DOC] cvs: phpdoc /it/functions var.xml From: Luca Perugini (l.perugini <email protected>)
Date: 07/14/00

perugini Fri Jul 14 07:31:38 2000 EDT

  Modified files:
    /phpdoc/it/functions var.xml
  Log:
  Updated from english tree
  
  
Index: phpdoc/it/functions/var.xml
diff -u phpdoc/it/functions/var.xml:1.4 phpdoc/it/functions/var.xml:1.5
--- phpdoc/it/functions/var.xml:1.4 Sat Jun 24 12:31:40 2000
+++ phpdoc/it/functions/var.xml Fri Jul 14 07:31:38 2000
@@ -44,6 +44,75 @@
    </refsect1>
   </refentry>
 
+ <refentry id="function.call-user-method">
+ <refnamediv>
+ <refname>call_user_method</refname>
+ <refpurpose>
+ Call a user method on an specific object
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>mixed
+ <function>call_user_method</function>
+ </funcdef>
+ <paramdef>string
+ <parameter>method_name</parameter>
+ </paramdef>
+ <paramdef>object
+ <parameter>obj</parameter>
+ </paramdef>
+ <paramdef>mixed
+ <parameter><optional>parameter</optional></parameter>
+ </paramdef>
+ <paramdef>mixed
+ <parameter><optional>...</optional></parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ Calls a the method referred by <parameter>method_name</parameter> from
+ the user defined <parameter>obj</parameter> object. An example of usage
+ is below, where we define a class, instantiate an object and use
+ <function>call_user_method</function> to call indirectly its
+ <varname>print_info</varname> method.
+ <informalexample>
+ <programlisting role="php">
+&lt;?php
+class Country {
+ var $NAME;
+ var $TLD;
+
+ function Country($name, $tld) {
+ $this-&gt;NAME = $name;
+ $this-&gt;TLD = $tld;
+ }
+
+ function print_info($prestr=&quot;&quot;) {
+ echo $prestr.&quot;Country: &quot;.$this-&gt;NAME.&quot;\n&quot;;
+ echo $prestr.&quot;Top Level Domain: &quot;.$this-&gt;TLD.&quot;\n&quot;;
+ }
+}
+
+$cntry = new Country(&quot;Peru&quot;,&quot;pe&quot;);
+
+echo &quot;* Calling the object method directly\n&quot;;
+$cntry-&gt;print_info();
+
+echo &quot;\n* Calling the same method indirectly\n&quot;;
+call_user_method (&quot;print_info&quot;, $cntry, &quot;\t&quot;);
+?&gt;
+ </programlisting>
+ </informalexample>
+ </para>
+ </refsect1>
+ </refentry>
+
+
+
+
   <refentry id="function.doubleval">
    <refnamediv>
     <refname>doubleval</refname>