mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-02 21:31:48 +01:00
sync with EN
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: didou Status: ready -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: didou Status: ready -->
|
||||
<chapter id="tips">
|
||||
<title>Trucs et astuces</title>
|
||||
<para></para>
|
||||
@@ -11,7 +11,8 @@
|
||||
d<>faut pour une variable qui n'a pas <20>t<EFBFBD> assign<67>e, comme
|
||||
pour afficher "&nbsp;" afin que les couleurs de fond
|
||||
des tableaux fonctionnent. Beaucoup utiliseraient une
|
||||
instruction {if} pour g<>rer cel<65>, mais il existe un moyen
|
||||
instruction <link linkend="language.function.if">{if}</link>
|
||||
pour g<>rer cel<65>, mais il existe un moyen
|
||||
plus facile dans Smarty : l'utilisation du modificateur
|
||||
de variable <emphasis>default</emphasis>.
|
||||
</para>
|
||||
@@ -34,6 +35,11 @@
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.modifier.default">default</link> et
|
||||
<link linkend="tips.default.var.handling">la gestion des variables par d<>faut</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="tips.default.var.handling">
|
||||
@@ -56,6 +62,11 @@
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.modifier.default">default</link> et
|
||||
<link linkend="tips.blank.var.handling">la gestion des variables non-assign<67>es</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
<sect1 id="tips.passing.vars">
|
||||
<title>Passage du titre <20> un template d'en-t<>te</title>
|
||||
@@ -124,7 +135,7 @@ footer.tpl
|
||||
<para>
|
||||
A partir Smarty 1.4.0, vous pouvez passer les dates <20> Smarty
|
||||
sous la forme de timestamps Unix ou MySQL, ou tout autre format de dates
|
||||
que comprend strtotime().
|
||||
que comprend <ulink url="&url.php-manual;strtotime">strtotime()</ulink>.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
@@ -164,7 +175,8 @@ Jan 4, 2001
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
En utilisant la fonction {html_select_date} dans un template, le programmeur
|
||||
En utilisant la fonction <link linkend="language.function.html.select.date">{html_select_date}</link>
|
||||
dans un template, le programmeur
|
||||
veut en g<>n<EFBFBD>ral convertir le r<>sultat d'un formulaire en un timestamp.
|
||||
Voici une fonction qui devrait vous <20>tre utile.
|
||||
</para>
|
||||
@@ -271,7 +283,8 @@ function insert_header()
|
||||
Traditionnellemnt, la programmation avec des templates dans les applications
|
||||
se d<>roule de la fa<66>on suivante : d'abord vous r<>cup<75>rez vos variables
|
||||
dans l'application PHP (peut-<2D>tre avec des requ<71>tes en base de donn<6E>es), puis
|
||||
vous instanciez votre objet Smarty, assignez les variables et affichez le
|
||||
vous instanciez votre objet Smarty, <link linkend="api.assign">assignez</link>
|
||||
les variables et <link linkend="api.display">affichez</link> le
|
||||
template. Disons par exemple que nous avons un t<>l<EFBFBD>scripteur dans
|
||||
notre template. Nous r<>cup<75>rerions les donn<6E>es dans notre application,
|
||||
puis les assignerions ensuite pour les afficher. Mais ne serait-ce pas
|
||||
@@ -320,6 +333,12 @@ Stock Name: {$ticker.name} Stock Price: {$ticker.price}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.function.include.php">{include_php}</link>,
|
||||
<link linkend="language.function.include">{include}</link> et
|
||||
<link linkend="language.function.php">{php}</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
<sect1 id="tips.obfuscating.email">
|
||||
<title>Dissimuler les adresses email</title>
|
||||
@@ -350,6 +369,10 @@ Send inquiries to
|
||||
peu probable.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.modifier.escape">escape</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.syntax.quotes">
|
||||
<title>Variables ins<6E>r<EFBFBD>es dans des cha<68>nes de caract<63>res</title>
|
||||
<para>
|
||||
@@ -16,7 +16,7 @@
|
||||
<title>Syntaxe d'insertion de variables dans des cha<68>nes</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
EXEMPLE DE SYNTAXE:
|
||||
EXEMPLE DE SYNTAXE :
|
||||
{func var="test $foo test"} <-- comprends $foo
|
||||
{func var="test $foo_bar test"} <-- comprends $foo_bar
|
||||
{func var="test $foo[0] test"} <-- comprends $foo[0]
|
||||
@@ -31,6 +31,10 @@ EXEMPLE PRATIQUE:
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.modifier.escape">escape</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: yannick Status: ready -->
|
||||
<sect1 id="language.syntax.variables">
|
||||
<title>Variables</title>
|
||||
<para>
|
||||
@@ -39,6 +39,11 @@ Plusieurs autres combinaisons sont autoris
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.variables.smarty">les variables r<>serv<72>es $smarty</link> et
|
||||
<link linkend="language.config.variables">les variables de configuration</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.config.load">
|
||||
<title>config_load</title>
|
||||
<informaltable frame="all">
|
||||
@@ -128,7 +128,7 @@
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="config.files">les fichiers de configuration</link> et
|
||||
<link linkend="language.function.config.load">config_load</link>.
|
||||
<link linkend="language.config.variables">les variables de configuration</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.foreach">
|
||||
<title>foreach,foreachelse</title>
|
||||
<informaltable frame="all">
|
||||
@@ -54,7 +54,8 @@
|
||||
</informaltable>
|
||||
<para>
|
||||
Les boucles <emphasis>foreach</emphasis> sont une alternative aux boucles
|
||||
<emphasis>section</emphasis>. Les boucles <emphasis>foreach</emphasis>
|
||||
<link linkend="language.function.section"><emphasis>section</emphasis></link>.
|
||||
Les boucles <emphasis>foreach</emphasis>
|
||||
sont utilis<69>es pour parcourir des tableaux associatifs simples.
|
||||
La syntaxe des boucles <emphasis>foreach</emphasis> est bien plus simple
|
||||
que celle des boucles <emphasis>section</emphasis>, mais en contrepartie,
|
||||
@@ -73,47 +74,116 @@
|
||||
</para>
|
||||
<example>
|
||||
<title>foreach</title>
|
||||
<programlisting>
|
||||
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* Cet exemple affiche toutes les valeurs du tableau $custid *}
|
||||
{foreach from=$custid item=curr_id}
|
||||
id: {$curr_id}<br>
|
||||
id: {$curr_id}<br />
|
||||
{/foreach}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
|
||||
SORTIE:
|
||||
|
||||
id: 1000<br>
|
||||
id: 1001<br>
|
||||
id: 1002<br></programlisting>
|
||||
id: 1000<br />
|
||||
id: 1001<br />
|
||||
id: 1002<br />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>foreach key</title>
|
||||
<programlisting>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* key contient la clef de chaque <20>l<EFBFBD>ment parcouru
|
||||
|
||||
l'attribution des <20>l<EFBFBD>ment est de la forme:
|
||||
|
||||
$smarty->assign("contacts", array(array("tel" => "1", "fax" => "2", "portable" => "3"),
|
||||
array("tel" => "555-4444", "fax" => "555-3333", "portable" => "760-1234")));
|
||||
$smarty->assign("contacts", array(array("tel" => "1", "fax" => "2", "portable" => "3"),
|
||||
array("tel" => "555-4444", "fax" => "555-3333", "portable" => "760-1234")));
|
||||
|
||||
*}
|
||||
|
||||
{foreach name=outer item=contact from=$contacts}
|
||||
{foreach key=key item=item from=$contact}
|
||||
{$key}: {$item}<br>
|
||||
{$key}: {$item}<br />
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
|
||||
SORTIE:
|
||||
|
||||
tel: 1<br>
|
||||
fax: 2<br>
|
||||
portable: 3<br>
|
||||
tel: 555-4444<br>
|
||||
fax: 555-3333<br>
|
||||
portable: 760-1234<br></programlisting>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
tel: 1<br />
|
||||
fax: 2<br />
|
||||
portable: 3<br />
|
||||
tel: 555-4444<br />
|
||||
fax: 555-3333<br />
|
||||
portable: 760-1234<br />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Les boucles Foreach ont <20>galement leurs propres variables qui g<>rent les propri<72>t<EFBFBD>s
|
||||
de foreach. Elles sont indiqu<71>es par : {$smarty.foreach.foreachname.varname}
|
||||
o<> foreachname est le nom sp<73>cifi<66> par l'attribut <emphasis>name</emphasis>
|
||||
de foreach.
|
||||
</para>
|
||||
|
||||
<sect2 id="foreach.property.iteration">
|
||||
<title>iteration</title>
|
||||
<para>
|
||||
<emphasis>iteration</emphasis> est utilis<69> pour afficher l'it<69>ration de la boucle courante.
|
||||
</para>
|
||||
<para>
|
||||
<emphasis>iteration</emphasis> commence toujours par 1 et est incr<63>ment<6E>
|
||||
<20> chaque it<69>ration.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="foreach.property.first">
|
||||
<title>first</title>
|
||||
<para>
|
||||
<emphasis>first</emphasis> est d<>fini <20> true si l'it<69>ration courante de foreach est la premi<6D>re.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="foreach.property.last">
|
||||
<title>last</title>
|
||||
<para>
|
||||
<emphasis>last</emphasis> est d<>fini <20> true si l'it<69>ration courante de foreach est la derni<6E>re.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="foreach.property.show">
|
||||
<title>show</title>
|
||||
<para>
|
||||
<emphasis>show</emphasis> est utilis<69> en tant que param<61>tre de foreach.
|
||||
<emphasis>show</emphasis> est un bool<6F>en (true ou false).
|
||||
S'il vaut false, foreach ne sera pas affich<63>. Si foreachelse est pr<70>sent,
|
||||
il sera affich<63> alternativement.
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
<sect2 id="foreach.property.total">
|
||||
<title>total</title>
|
||||
<para>
|
||||
<emphasis>total</emphasis> est utilis<69> pour afficher le nombre d'it<69>rations
|
||||
boucl<63>es par ce foreach. Il peut <20>tre utilis<69> dans ou apr<70>s le foreach.
|
||||
</para>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.function.section">{section}</link> et
|
||||
<link linkend="language.variables.smarty.loops">$smarty.foreach</link>.
|
||||
</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.if">
|
||||
<title>if,elseif,else</title>
|
||||
<para>
|
||||
l'instruction if dans Smarty dispose de la m<>me flexibilit<69> que l'instruction
|
||||
L'instruction <emphasis>{if}</emphasis> dans Smarty dispose de la m<>me flexibilit<69> que l'instruction
|
||||
PHP du m<>me nom, avec quelques fonctionnalit<69>s suppl<70>mentaires pour le
|
||||
moteur de template. Tous les <emphasis>if</emphasis> doivent <20>tre
|
||||
utilis<69>s de pair avec un <emphasis>/if</emphasis>.
|
||||
<emphasis>else</emphasis> et <emphasis>elseif</emphasis> sont <20>galement
|
||||
des balises autoris<69>es. "eq", "ne","neq", "gt", "lt", "lte", "le",
|
||||
"gte" "ge","is even","is odd", "is not even","is not odd","not","mod",
|
||||
"div by","even by","odd by","==", "===", "!=",">", "<","<=",">=" sont tous des op<6F>rateurs conditionnels valides, et doivent obligatoirement <20>tre
|
||||
s<>par<61>s des autres <20>l<EFBFBD>ments par des espaces.
|
||||
moteur de template. Tous les <emphasis>{if}</emphasis> doivent <20>tre
|
||||
utilis<69>s de pair avec un <emphasis>{/if}</emphasis>.
|
||||
<emphasis>{else}</emphasis> et <emphasis>{elseif}</emphasis> sont <20>galement
|
||||
des balises autoris<69>es. Toutes les conditions PHP sont reconnues,
|
||||
comme <emphasis>||</emphasis>, <emphasis>or</emphasis>,
|
||||
<emphasis>&&</emphasis>, <emphasis>and</emphasis>, etc.
|
||||
</para>
|
||||
<para>
|
||||
La liste suivante pr<70>sente les op<6F>rateurs reconnus, qui doivent <20>tre entour<75>s d'espaces.
|
||||
@@ -80,11 +79,11 @@
|
||||
<entry><=</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>====</entry>
|
||||
<entry>===</entry>
|
||||
<entry></entry>
|
||||
<entry>$a === 0</entry>
|
||||
<entry><EFBFBD>galit<EFBFBD> (type et valeur)</entry>
|
||||
<entry>====</entry>
|
||||
<entry>===</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>!</entry>
|
||||
@@ -137,71 +136,74 @@
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</informaltable>
|
||||
<example>
|
||||
<title>Instruction if</title>
|
||||
<programlisting>
|
||||
{if $name eq "Fred"}
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{if $name eq "Fred"}
|
||||
Bienvenue, Monsieur.
|
||||
{elseif $name eq "Wilma"}
|
||||
{elseif $name eq "Wilma"}
|
||||
Bienvenue m'dame.
|
||||
{else}
|
||||
{else}
|
||||
Bienvenue, qui que vous soyez.
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{* Un exemple avec l'op<6F>rateur or *}
|
||||
{if $name eq "Fred" or $name eq "Wilma"}
|
||||
{* Un exemple avec l'op<6F>rateur or *}
|
||||
{if $name eq "Fred" or $name eq "Wilma"}
|
||||
...
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{* m<>me chose que ci-dessus *}
|
||||
{if $name == "Fred" || $name == "Wilma"}
|
||||
{* m<>me chose que ci-dessus *}
|
||||
{if $name == "Fred" || $name == "Wilma"}
|
||||
...
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{* l'exemple suivant NE fonctionne PAS, les op<6F>rateurs
|
||||
{* l'exemple suivant NE fonctionne PAS, les op<6F>rateurs
|
||||
doivent <20>tre entour<75>s d'espaces. *}
|
||||
{if $name=="Fred" || $name=="Wilma"}
|
||||
{if $name=="Fred" || $name=="Wilma"}
|
||||
...
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
|
||||
{* les parenth<74>ses sont autoris<69>es *}
|
||||
{if ( $amount < 0 or $amount > 1000 ) and $volume >= #minVolAmt#}
|
||||
{* les parenth<74>ses sont autoris<69>es *}
|
||||
{if ( $amount < 0 or $amount > 1000 ) and $volume >= #minVolAmt#}
|
||||
...
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{* vous pouvez <20>galement faire appel aux fonctions PHP *}
|
||||
{if count($var) gt 0}
|
||||
{* vous pouvez <20>galement faire appel aux fonctions PHP *}
|
||||
{if count($var) gt 0}
|
||||
...
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{* teste si les valeurs sont paires(even) ou impaires(odd) *}
|
||||
{if $var is even}
|
||||
{* teste si les valeurs sont paires(even) ou impaires(odd) *}
|
||||
{if $var is even}
|
||||
...
|
||||
{/if}
|
||||
{if $var is odd}
|
||||
{/if}
|
||||
{if $var is odd}
|
||||
...
|
||||
{/if}
|
||||
{if $var is not odd}
|
||||
{/if}
|
||||
{if $var is not odd}
|
||||
...
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{* teste si la variable est divisble par 4 *}
|
||||
{if $var is div by 4}
|
||||
{* teste si la variable est divisible par 4 *}
|
||||
{if $var is div by 4}
|
||||
...
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{* teste si la variable est paire, par groupe de deux i.e.,
|
||||
0=paire, 1=paire, 2=impaire, 3=impaire, 4=paire, 5=paire, etc. *}
|
||||
{if $var is even by 2}
|
||||
{* teste si la variable est paire, par groupe de deux i.e.,
|
||||
0=paire, 1=paire, 2=impaire, 3=impaire, 4=paire, 5=paire, etc. *}
|
||||
{if $var is even by 2}
|
||||
...
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{* 0=paire, 1=paire, 2=paire, 3=impaire, 4=impaire, 5=impaire, etc. *}
|
||||
{if $var is even by 3}
|
||||
{* 0=paire, 1=paire, 2=paire, 3=impaire, 4=impaire, 5=impaire, etc. *}
|
||||
{if $var is even by 3}
|
||||
...
|
||||
{/if}</programlisting>
|
||||
{/if}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.include.php">
|
||||
<title>include_php</title>
|
||||
<informaltable frame="all">
|
||||
@@ -15,7 +15,7 @@
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>D<EFBFBD>faut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
@@ -33,7 +33,7 @@
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Inclure plusieurs fois ou non le fichier PHP si
|
||||
plusieurs demandes d'inclusions sont faites.</entry>
|
||||
plusieurs demandes d'inclusions sont fa<EFBFBD>tes.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
@@ -61,7 +61,7 @@
|
||||
</note>
|
||||
|
||||
<para>
|
||||
les balises include_php sont utilis<69>es pour inclure directement
|
||||
Les balises include_php sont utilis<69>es pour inclure directement
|
||||
un script PHP dans vos templates. Si "security" est activ<69>, alors le script
|
||||
<20> ex<65>cuter doit <20>tre plac<61> dans le chemin $trusted_dir. La balise
|
||||
include_php attends l'attribut "file", qui contient le chemin du
|
||||
@@ -96,12 +96,13 @@
|
||||
L'objet Smarty est disponible en tant que $this dans le script PHP inclus.
|
||||
</para>
|
||||
<example>
|
||||
<title>fonction include_php</title>
|
||||
<programlisting>
|
||||
load_nav.php
|
||||
-------------
|
||||
<title>Fonction include_php</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
load_nav.php
|
||||
-------------
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
// charge des variables depuis une base de donn<6E>es mysql et les assigne au template.
|
||||
require_once("MySQL.class.php");
|
||||
@@ -109,21 +110,25 @@ load_nav.php
|
||||
$sql->query("select * from site_nav_sections order by name",SQL_ALL);
|
||||
$this->assign('sections',$sql->record);
|
||||
|
||||
?>
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<> index.tpl est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* chemin absolu, ou relatif <20> $trusted_dir *}
|
||||
{include_php file="/chemin/vers/load_nav.php"}
|
||||
|
||||
|
||||
index.tpl
|
||||
---------
|
||||
|
||||
{* chemin absolu, ou relatif <20> $trusted_dir *}
|
||||
{include_php file="/path/to/load_nav.php"}
|
||||
|
||||
{foreach item="curr_section" from=$sections}
|
||||
<a href="{$curr_section.url}">{$curr_section.name}</a><br>
|
||||
{/foreach}</programlisting>
|
||||
{foreach item="curr_section" from=$sections}
|
||||
<a href="{$curr_section.url}">{$curr_section.name}</a><br />
|
||||
{/foreach}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.insert">
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.insert">
|
||||
<title>insert</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
@@ -71,9 +71,9 @@
|
||||
</para>
|
||||
<example>
|
||||
<title>function insert</title>
|
||||
<programlisting>
|
||||
{* exemple de r<>cup<75>ration d'un bandeau publicitaire *}
|
||||
{insert name="getBanner" lid=#emplacement_bandeau# sid=#id_site#}</programlisting>
|
||||
<programlisting>
|
||||
{* exemple de r<>cup<75>ration d'un bandeau publicitaire *}
|
||||
{insert name="getBanner" lid=#emplacement_bandeau# sid=#id_site#}</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Dans cet exemple, nous utilisons le nom getBanner et lui passons les
|
||||
@@ -123,22 +123,22 @@
|
||||
</note>
|
||||
</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
|
||||
-->
|
||||
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
|
||||
-->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.literal">
|
||||
<title>literal</title>
|
||||
<para>
|
||||
@@ -15,13 +15,13 @@
|
||||
les d<>limiteurs individuels.
|
||||
</para>
|
||||
<example>
|
||||
<title>balises literal</title>
|
||||
<title>Balises literal</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{literal}
|
||||
<script language=javascript>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
function isblank(field) {
|
||||
if (field.value == '')
|
||||
{ return false; }
|
||||
@@ -31,7 +31,7 @@
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// -->
|
||||
// -->
|
||||
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.php">
|
||||
<title>php</title>
|
||||
<para>
|
||||
@@ -12,12 +12,15 @@
|
||||
</para>
|
||||
<example>
|
||||
<title>balises php</title>
|
||||
<programlisting>
|
||||
{php}
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{php}
|
||||
// inclusion directe d'un script PHP
|
||||
// depuis le template.
|
||||
include("/path/to/display_weather.php");
|
||||
{/php}</programlisting>
|
||||
{/php}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: gerlad Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: gerlad Status: ready -->
|
||||
<sect1 id="language.function.strip">
|
||||
<title>strip</title>
|
||||
<para>
|
||||
@@ -26,11 +26,11 @@
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>balises strip</title>
|
||||
<programlisting>
|
||||
<title>Balises strip</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* la suite sera affich<63>e sur une seule ligne *}
|
||||
{strip}
|
||||
<![CDATA[
|
||||
<table border=0>
|
||||
<tr>
|
||||
<td>
|
||||
@@ -41,14 +41,17 @@
|
||||
</tr>
|
||||
</table>
|
||||
{/strip}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<table border=0><tr><td><A HREF="http://mon.example.com"><font color="red">Un test</font></A></td></tr></table>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Notez que dans l'exemple ci-dessus, toutes les lignes commencent et
|
||||
se terminent par des balises HTML. Sachez que si vous avez du texte
|
||||
|
||||
Reference in New Issue
Block a user