mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-30 03:41:36 +01:00
98 lines
3.0 KiB
XML
98 lines
3.0 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready -->
|
|
|
|
<sect1 id="plugins.naming.conventions">
|
|
<title>Conventions de nommage</title>
|
|
<para>
|
|
Les fichiers et les fonctions de plugins doivent suivre une convention
|
|
de nommage très spécifique pour être localisés par Smarty.
|
|
</para>
|
|
<para>
|
|
Les fichiers de <emphasis role="bold">plugins</emphasis> doivent être nommés de la façon suivante :
|
|
<blockquote>
|
|
<para>
|
|
<filename>
|
|
<replaceable>type</replaceable>.<replaceable>nom</replaceable>.php
|
|
</filename>
|
|
</para>
|
|
</blockquote>
|
|
</para>
|
|
|
|
<itemizedlist>
|
|
<listitem><para>
|
|
Où <literal>type</literal> est l'une des valeurs suivantes :
|
|
<itemizedlist spacing="compact">
|
|
<listitem><simpara>function</simpara></listitem>
|
|
<listitem><simpara>modifier</simpara></listitem>
|
|
<listitem><simpara>block</simpara></listitem>
|
|
<listitem><simpara>compiler</simpara></listitem>
|
|
<listitem><simpara>prefilter</simpara></listitem>
|
|
<listitem><simpara>postfilter</simpara></listitem>
|
|
<listitem><simpara>outputfilter</simpara></listitem>
|
|
<listitem><simpara>resource</simpara></listitem>
|
|
<listitem><simpara>insert</simpara></listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</listitem>
|
|
|
|
<listitem><para>
|
|
Et <literal>nom</literal> doit être un identifiant valide : lettres, nombres
|
|
et underscore seulement, voir les
|
|
<ulink url="&url.php-manual;language.variables">variables php</ulink>.
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
Quelques exemples : <filename>function.html_select_date.php</filename>,
|
|
<filename>resource.db.php</filename>,
|
|
<filename>modifier.spacify.php</filename>.
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
<para>
|
|
Les fonctions de <emphasis role="bold">plugins</emphasis> dans les fichiers de plugins doivent être
|
|
nommées de la façon suivante :
|
|
<blockquote>
|
|
<para>
|
|
<function>smarty_<replaceable>type</replaceable>_<replaceable>nom</replaceable></function>
|
|
</para>
|
|
</blockquote>
|
|
</para>
|
|
|
|
<itemizedlist>
|
|
<listitem><para>
|
|
Les significations de <literal>type</literal> et de <literal>nom</literal> sont les mêmes
|
|
que précédemment.
|
|
</para></listitem>
|
|
<listitem><para>
|
|
Un exemple de nom de modificateur <varname>foo</varname> serait
|
|
<literal>function smarty_modifier_foo()</literal>.
|
|
</para></listitem>
|
|
</itemizedlist>
|
|
<para>
|
|
Smarty donnera des messages d'erreurs appropriés si le fichier de plugin
|
|
n'est pas trouvé ou si le fichier ou la fonction de plugin ne sont
|
|
pas nommés correctement.
|
|
</para>
|
|
</sect1>
|
|
|
|
<!-- 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
|
|
--> |