mirror of
https://github.com/php/doc-fr.git
synced 2026-03-24 15:12:13 +01:00
163 lines
4.3 KiB
XML
163 lines
4.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: ba50f222e7108287fb6eb11265c2b28efe0cc0ce Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xml:id="function.highlight-string" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>highlight_string</refname>
|
|
<refpurpose>Applique la syntaxe colorisée à du code PHP</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>string</type><type>true</type></type><methodname>highlight_string</methodname>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>return</parameter><initializer>&false;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
Affiche ou retourne le code HTML de la version colorisée du code PHP contenu
|
|
dans le paramètre <parameter>str</parameter>, en utilisant les couleurs du
|
|
système interne de colorisation de PHP.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>string</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le code PHP à coloriser. Doit également inclure les balises d'ouverture.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>return</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Définir ce paramètre à &true; pour faire que cette fonction retourne
|
|
le code colorisé.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Si le second paramètre optionnel <parameter>return</parameter> est fourni,
|
|
et vaut &true; alors <function>highlight_string</function> retournera
|
|
la chaîne colorisée au lieu de l'afficher immédiatement. Si le second
|
|
paramètre ne vaut pas &true; alors <function>highlight_string</function>
|
|
retournera &true;.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.4.0</entry>
|
|
<entry>
|
|
Le type de retour est passé de <type class="union"><type>string</type><type>bool</type></type> à <type class="union">
|
|
<type>string</type><type>true</type></type>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>8.3.0</entry>
|
|
<entry>
|
|
Le HTML résultant a changé.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>highlight_string</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
highlight_string('<?php phpinfo(); ?>');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
<code><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</code>
|
|
]]>
|
|
</screen>
|
|
&example.outputs.83;
|
|
<screen>
|
|
<![CDATA[
|
|
<pre><code style="color: #000000"><span style="color: #0000BB"><?php phpinfo</span><span style="color: #007700">(); </span><span style="color: #0000BB">?></span></code></pre>
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
¬e.uses-ob;
|
|
<para>
|
|
Le code HTML généré est sujet à changement.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>highlight_file</function></member>
|
|
<member><link linkend="ini.syntax-highlighting">Les directives INI de coloration</link></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
|
|
-->
|