mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-25 17:32:07 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@352230 c90b9560-bf6c-de11-be94-00142212c4b1
151 lines
3.9 KiB
XML
151 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 0c9c2dd669fe9395eaa73d487fbd160f9057429a Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xml:id="function.forward-static-call-array" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>forward_static_call_array</refname>
|
|
<refpurpose>Appelle une méthode statique et passe les arguments en tableau</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>mixed</type><methodname>forward_static_call_array</methodname>
|
|
<methodparam><type>callable</type><parameter>callback</parameter></methodparam>
|
|
<methodparam><type>array</type><parameter>args</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Appelle une fonction ou une méthode utilisateur, nommée <parameter>callback</parameter>,
|
|
avec les arguments rassemblés dans un tableau. Cette fonction doit être appelée depuis
|
|
une méthode, et ne peut pas être utilisée hors d'une classe.
|
|
Elle utilise le <link linkend="language.oop5.late-static-bindings">liage statique</link>.
|
|
Tous les arguments transmis sont passés par valeur dans un tableau, similairement à
|
|
<function>call_user_func_array</function>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>callback</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La fonction ou la méthode appelée. Ce paramètre peut être un tableau,
|
|
avec le nom de la classe et de la méthode, ou une chaîne, avec le nom
|
|
de la fonction.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>parameter</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un paramètre, rassemblant tous les paramètres dans un tableau.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Notez que les paramètres sont passés par valeur
|
|
par <function>forward_static_call_array</function>.
|
|
</para>
|
|
</note>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne le résultat de la fonction, et &false; en cas d'erreur.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>forward_static_call_array</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
class A
|
|
{
|
|
const NAME = 'A';
|
|
public static function test() {
|
|
$args = func_get_args();
|
|
echo static::NAME, " ".join(',', $args)." \n";
|
|
}
|
|
}
|
|
|
|
class B extends A
|
|
{
|
|
const NAME = 'B';
|
|
|
|
public static function test() {
|
|
echo self::NAME, "\n";
|
|
forward_static_call_array(array('A', 'test'), array('encore', 'args'));
|
|
forward_static_call_array( 'test', array('autres', 'args'));
|
|
}
|
|
}
|
|
|
|
B::test('foo');
|
|
|
|
function test() {
|
|
$args = func_get_args();
|
|
echo "C ".join(',', $args)." \n";
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
B
|
|
B encore,args
|
|
C autres,args
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>forward_static_call</function></member>
|
|
<member><function>call_user_func</function></member>
|
|
<member><function>call_user_func_array</function></member>
|
|
<member><function>is_callable</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
|
|
-->
|