mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-27 10:22:07 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@186257 c90b9560-bf6c-de11-be94-00142212c4b1
112 lines
2.7 KiB
XML
112 lines
2.7 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.11 $ -->
|
|
<!-- EN-Revision: 1.9 Maintainer: dams Status: ready -->
|
|
<refentry id="function.get-class-methods">
|
|
<refnamediv>
|
|
<refname>get_class_methods</refname>
|
|
<refpurpose>Retourne les noms des méthodes d'une classe</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>get_class_methods</methodname>
|
|
<methodparam><type>mixed</type><parameter>class_name</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>get_class_methods</function> retourne un tableau contenant les
|
|
noms des méthodes de la classe <parameter>class_name</parameter>.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
A partir de &php; 4.0.6, vous pouvez spécifier l'objet lui-même, au lieu
|
|
de sa classe <parameter>class_name</parameter>. Par exemple :
|
|
<example>
|
|
<title>
|
|
Passer l'objet ou la classe à <function>get_class_methods</function>
|
|
</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$class_methods = get_class_methods($my_class);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</note>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>get_class_methods</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
class maclasse {
|
|
// constructeur
|
|
function maclasse() {
|
|
return(TRUE);
|
|
}
|
|
// méthode 1
|
|
function myfunc1() {
|
|
return(TRUE);
|
|
}
|
|
// méthode 2
|
|
function mafunc2() {
|
|
return(TRUE);
|
|
}
|
|
}
|
|
$ma_classe = new maclasse();
|
|
|
|
$class_methods = get_class_methods(get_class($ma_classe));
|
|
|
|
foreach ($class_methods as $method_name) {
|
|
echo "$method_name\n";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
maclasse
|
|
myfunc1
|
|
mafunc2
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<warning>
|
|
<para>
|
|
Depuis &php; 5, cette fonction retourne le nom des méthodes comme
|
|
elles ont été déclarées (sensible à la casse). En &php; 4, elles étaient
|
|
converties en minuscule.
|
|
</para>
|
|
</warning>
|
|
<simpara>
|
|
Voir aussi
|
|
<function>get_class_vars</function> et
|
|
<function>get_object_vars</function>
|
|
</simpara>
|
|
</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:"../../../../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
|
|
-->
|