2004-04-13 15:43:47 +00:00
|
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
|
|
|
|
<!-- $Revision$ -->
|
2006-09-30 10:04:12 +00:00
|
|
|
|
<!-- EN-Revision: 1.10 Maintainer: yannick Status: ready -->
|
2006-04-09 21:59:55 +00:00
|
|
|
|
|
2004-05-23 15:50:53 +00:00
|
|
|
|
<sect1 id="language.syntax.functions">
|
|
|
|
|
|
<title>Fonctions</title>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Les balises Smarty affichent une <link linkend="language.variables">variable</link>
|
2006-04-09 21:59:55 +00:00
|
|
|
|
ou invoquent une fonction. Elles sont appel<65>es
|
2005-07-10 19:44:16 +00:00
|
|
|
|
lorsqu'elles sont entour<75>es, ainsi que leurs
|
|
|
|
|
|
<link linkend="language.syntax.attributes">param<EFBFBD>tres</link>, des d<>limiteurs Smarty.
|
2006-09-30 10:04:12 +00:00
|
|
|
|
Par exemple : <literal>{nomfonction attr1='val' attr2='val'}</literal>.
|
2004-05-23 15:50:53 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
<example>
|
|
|
|
|
|
<title>syntaxe des fonctions</title>
|
2004-11-08 02:10:34 +00:00
|
|
|
|
<programlisting>
|
2004-07-02 19:49:32 +00:00
|
|
|
|
<![CDATA[
|
2006-03-22 17:30:04 +00:00
|
|
|
|
{config_load file='colors.conf'}
|
|
|
|
|
|
{include file='header.tpl'}
|
2006-04-09 21:59:55 +00:00
|
|
|
|
{insert file='banner_ads.tpl' title='Smarty est cool !'}
|
2004-04-13 15:43:47 +00:00
|
|
|
|
|
2006-04-09 21:59:55 +00:00
|
|
|
|
{if $logged_in}
|
2006-03-22 17:30:04 +00:00
|
|
|
|
Bonjour, <font color="{#fontColor#}">{$name}!</font>
|
2004-04-13 15:43:47 +00:00
|
|
|
|
{else}
|
2006-03-22 17:30:04 +00:00
|
|
|
|
Bonjour, {$name}!
|
2004-04-13 15:43:47 +00:00
|
|
|
|
{/if}
|
|
|
|
|
|
|
2006-04-09 21:59:55 +00:00
|
|
|
|
{include file='footer.tpl' ad=$random_id}
|
2004-07-02 19:49:32 +00:00
|
|
|
|
]]>
|
2004-11-08 02:10:34 +00:00
|
|
|
|
</programlisting>
|
2004-05-23 15:50:53 +00:00
|
|
|
|
</example>
|
2006-09-30 10:04:12 +00:00
|
|
|
|
<itemizedlist>
|
|
|
|
|
|
<listitem>
|
2004-05-23 15:50:53 +00:00
|
|
|
|
<para>
|
2005-05-24 20:46:11 +00:00
|
|
|
|
Les <link linkend="language.builtin.functions">fonctions natives</link> et les
|
|
|
|
|
|
<link linkend="language.custom.functions">fonctions utilisateurs</link> ont toutes deux la m<>me
|
2005-07-10 19:44:16 +00:00
|
|
|
|
syntaxe, dans les templates.
|
2006-09-30 10:04:12 +00:00
|
|
|
|
</para></listitem>
|
|
|
|
|
|
|
|
|
|
|
|
<listitem>
|
2005-07-10 19:44:16 +00:00
|
|
|
|
<para>
|
|
|
|
|
|
Les fonctions natives sont relatives
|
|
|
|
|
|
au traitement <emphasis role="bold">interne</emphasis> de Smarty,
|
2006-09-30 10:04:12 +00:00
|
|
|
|
comme <link linkend="language.function.if"><varname>{if}</varname></link>,
|
|
|
|
|
|
<link linkend="language.function.section"><varname>{section}</varname></link> et
|
|
|
|
|
|
<link linkend="language.function.strip"><varname>{strip}</varname></link>.
|
2006-04-09 21:59:55 +00:00
|
|
|
|
Il n'y a aucune raison <20> ce qu'elles soient modifi<66>es ou chang<6E>es.
|
2006-09-30 10:04:12 +00:00
|
|
|
|
</para></listitem>
|
|
|
|
|
|
|
|
|
|
|
|
<listitem>
|
2005-07-10 19:44:16 +00:00
|
|
|
|
<para>
|
|
|
|
|
|
Les fonctions utilisateurs sont des fonctions <emphasis role="bold">additionnelles</emphasis>,
|
|
|
|
|
|
impl<70>ment<6E>es par l'interm<72>diaire de <link linkend="plugins">plugins</link>.
|
2005-05-24 20:46:11 +00:00
|
|
|
|
Elles peuvent <20>tre modifi<66>es pour correspondre
|
|
|
|
|
|
<20> vos besoins, et vous pouvez en cr<63>er de nouvelles.
|
2006-09-30 10:04:12 +00:00
|
|
|
|
<link linkend="language.function.html.options"><varname>{html_options}</varname></link> et
|
|
|
|
|
|
<link linkend="language.function.popup"><varname>{popup}</varname></link>
|
2005-05-09 16:45:23 +00:00
|
|
|
|
sont deux exemples de fonctions utilisateurs.
|
2006-09-30 10:04:12 +00:00
|
|
|
|
</para></listitem>
|
|
|
|
|
|
</itemizedlist>
|
2006-04-09 21:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Voir aussi
|
2006-09-30 10:04:12 +00:00
|
|
|
|
<link linkend="api.register.function"><varname>register_function()</varname></link>.
|
2006-04-09 21:59:55 +00:00
|
|
|
|
</para>
|
2004-04-13 15:43:47 +00:00
|
|
|
|
</sect1>
|
2005-05-24 20:46:11 +00:00
|
|
|
|
|
2004-04-13 15:43:47 +00:00
|
|
|
|
<!-- 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
|
2005-05-24 20:46:11 +00:00
|
|
|
|
-->
|