mirror of
https://github.com/php/doc-it.git
synced 2026-03-27 09:02:09 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/it/trunk@84431 c90b9560-bf6c-de11-be94-00142212c4b1
110 lines
2.7 KiB
XML
110 lines
2.7 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- splitted from ./it/functions/classobj.xml, last change in rev 1.3 -->
|
|
<!-- last change to 'get-class-methods' in en/ tree in rev 1.2 -->
|
|
<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready -->
|
|
<!-- OLD-Revision: 1.38/EN.1.2 -->
|
|
<refentry id="function.get-class-methods">
|
|
<refnamediv>
|
|
<refname>get_class_methods</refname>
|
|
<refpurpose>Restituisce un array con i nomi dei metodi della classe</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Descrizione</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>get_class_methods</methodname>
|
|
<methodparam><type>string</type><parameter>nome_classe</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Questa funzione restituisce un array contenente i nomi dei metodi
|
|
definiti per la classe specificata da <parameter>nome_classe</parameter>.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Dalla versione 4.0.6 di PHP, si può specificare direttamente l'oggetto anziché
|
|
la classe nel parametro <parameter>nome_classe</parameter>. Ad esempio:
|
|
<informalexample>
|
|
<programlisting>
|
|
<![CDATA[
|
|
$metodi_della_classe = get_class_methods($mia_classe); // vedere di seguito l'esempio completo
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
</note>
|
|
<para>
|
|
<example>
|
|
<title>Esempio di <function>get_class_methods</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
class miaclasse {
|
|
// costruttore
|
|
function miaclasse() {
|
|
return(TRUE);
|
|
}
|
|
|
|
// metodo 1
|
|
function funzione1() {
|
|
return(TRUE);
|
|
}
|
|
|
|
// metodo 2
|
|
function funzione2() {
|
|
return(TRUE);
|
|
}
|
|
}
|
|
|
|
$mio_oggetto = new miaclasse();
|
|
|
|
$metodi = get_class_methods(get_class($mio_oggetto));
|
|
|
|
foreach ($metodi as $nome_metodo) {
|
|
echo "$nome_metodo\n";
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Produrrà:
|
|
<informalexample>
|
|
<programlisting>
|
|
<![CDATA[
|
|
miaclasse
|
|
funzione1
|
|
funzione2
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<simpara>
|
|
Vedere anche <function>get_class_vars</function> e
|
|
<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
|
|
-->
|