mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02: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: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: gerald Status: ready -->
|
||||
|
||||
<sect1 id="language.syntax.attributes">
|
||||
<title>Param<EFBFBD>tres</title>
|
||||
@@ -15,10 +15,9 @@
|
||||
</para>
|
||||
<para>
|
||||
Certains param<61>tres requi<75>rent des valeurs bool<6F>ennes (true / false).
|
||||
Elles <link linkend="variable.config.booleanize">peuvent <20>tre sp<73>cifi<66>es</link>
|
||||
par l'une des valeures suivantes, sans guillemet: <literal>true</literal>,
|
||||
<literal>on</literal>, et <literal>yes</literal>, ou <literal>false</literal>,
|
||||
<literal>off</literal>, et <literal>no</literal>.
|
||||
Elles peuvent <20>tre sp<73>cifi<66>es par l'une des valeures suivantes, sans guillemet:
|
||||
<literal>true</literal>, <literal>on</literal>, et <literal>yes</literal>,
|
||||
ou <literal>false</literal>, <literal>off</literal>, et <literal>no</literal>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Param<EFBFBD>tres de fonction, syntaxe</title>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.syntax.comments">
|
||||
<title>Commentaires</title>
|
||||
@@ -24,13 +24,20 @@
|
||||
<!-- Un commentaire Html qui sera envoy<6F> au navigateur -->
|
||||
|
||||
{* ces multi-lignes sont des commentaires
|
||||
qui ne sont pas envoy<6F>es au navigateur
|
||||
qui ne sont pas envoy<6F>es au navigateur
|
||||
*}
|
||||
|
||||
{*********************************************************
|
||||
Un bloc de commentaires multilignes contenant les cr<63>dits
|
||||
@ author: bg@example.com
|
||||
@ maintainer: support@example.com
|
||||
@ para: var that sets block style
|
||||
@ css: the style output
|
||||
**********************************************************}
|
||||
|
||||
{* Inclusion du fichier d'en t<>te *}
|
||||
{include file='header.tpl'}
|
||||
|
||||
|
||||
{* Note aux d<>veloppeurs : $includeFile est assign<67> au script foo.php *}
|
||||
<!-- Affichage du bloc principal -->
|
||||
{include file=$includeFile}
|
||||
@@ -41,6 +48,8 @@
|
||||
{html_options options=$vals selected=$selected_id}
|
||||
</select>
|
||||
*}
|
||||
{* Balise cvs pour un template *}
|
||||
{* $Id: Exp $ *}
|
||||
|
||||
</body>
|
||||
]]>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready -->
|
||||
<sect1 id="language.syntax.functions">
|
||||
<title>Fonctions</title>
|
||||
<para>
|
||||
@@ -8,22 +8,23 @@
|
||||
ou invoquent une fonction. Les fonctions sont appel<65>es
|
||||
lorsqu'elles sont entour<75>es, ainsi que leurs
|
||||
<link linkend="language.syntax.attributes">param<EFBFBD>tres</link>, des d<>limiteurs Smarty.
|
||||
Par exemple : {nomfonction par1="val" par2="val"}.
|
||||
Par exemple : {nomfonction attr1='val' attr2='val'}.
|
||||
</para>
|
||||
<example>
|
||||
<title>syntaxe des fonctions</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{config_load file="colors.conf"}
|
||||
{include file="header.tpl"}
|
||||
{config_load file='colors.conf'}
|
||||
{include file='header.tpl'}
|
||||
{insert file='banner_ads.tpl'}
|
||||
|
||||
{if $name eq "Fred"}
|
||||
Vous <20>tes admis dans cette zone
|
||||
{if $highlight_name}
|
||||
Bonjour, <font color="{#fontColor#}">{$name}!</font>
|
||||
{else}
|
||||
Bienvenue, <font color="{#fontColor#}">{$name} !</font>
|
||||
Bonjour, {$name}!
|
||||
{/if}
|
||||
|
||||
{include file="footer.tpl"}
|
||||
{include file='footer.tpl'}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
@@ -38,7 +39,7 @@
|
||||
comme <link linkend="language.function.if">{if}</link>,
|
||||
<link linkend="language.function.section">{section}</link> et
|
||||
<link linkend="language.function.strip">{strip}</link>.
|
||||
Elles ne peuvent <20>tre modifi<66>es.
|
||||
Elles ne devraient pas <20>tre modifi<66>es.
|
||||
</para>
|
||||
<para>
|
||||
Les fonctions utilisateurs sont des fonctions <emphasis role="bold">additionnelles</emphasis>,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.11 Maintainer: yannick Status: ready -->
|
||||
<sect1 id="language.syntax.variables">
|
||||
<title>Variables</title>
|
||||
<para>
|
||||
@@ -38,13 +38,25 @@ Plusieurs autres combinaisons sont autoris
|
||||
{$foo.bar.baz[4]}
|
||||
{$foo->bar($baz,2,$bar)} <-- passage de param<61>tres
|
||||
{"foo"} <-- les valeurs statiques sont autoris<69>es
|
||||
|
||||
{* affiche la variable serveur "SERVER_NAME" ($_SERVER['SERVER_NAME'])*}
|
||||
{$smarty.server.SERVER_NAME}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Les variables sp<73>ciales comme get, post, session, etc. sont <20>galement disponibles,
|
||||
lisez le chapitre sur les variables r<>serv<72>es
|
||||
<link linkend="language.variables.smarty">$smarty</link> pour plus de d<>tails.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.variables.smarty">les variables r<EFBFBD>serv<EFBFBD>es $smarty</link> et
|
||||
<link linkend="language.config.variables">les variables de configuration</link>.
|
||||
<link linkend="language.variables.smarty">$smarty reserved variables</link>,
|
||||
<link linkend="language.config.variables">Config Variables</link>,
|
||||
<link linkend="language.function.assign">{assign}</link> et
|
||||
<link linkend="api.assign">assign()</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.function.if">
|
||||
<title>{if},{elseif},{else}</title>
|
||||
@@ -149,21 +149,21 @@
|
||||
<title>Instruction {if}</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{if $name eq "Fred"}
|
||||
{if $name eq 'Fred'}
|
||||
Bienvenue, Monsieur.
|
||||
{elseif $name eq "Wilma"}
|
||||
{elseif $name eq 'Wilma'}
|
||||
Bienvenue m'dame.
|
||||
{else}
|
||||
Bienvenue, qui que vous soyez.
|
||||
{/if}
|
||||
|
||||
{* Un exemple avec l'op<6F>rateur or *}
|
||||
{if $name eq "Fred" or $name eq "Wilma"}
|
||||
{if $name eq 'Fred' or $name eq 'Wilma'}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* m<>me chose que ci-dessus *}
|
||||
{if $name == "Fred" || $name == "Wilma"}
|
||||
{if $name == 'Fred' || $name == 'Wilma'}
|
||||
...
|
||||
{/if}
|
||||
|
||||
@@ -217,6 +217,22 @@
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Plus d'exemples avec {if}</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{if isset($name) && $name = 'Blog'}
|
||||
{* faire quelque chose *}
|
||||
{elseif $name == $foo}
|
||||
{* faire quelque chose *}
|
||||
{/if}
|
||||
|
||||
{if is_array($foo) && count($foo) > 0)
|
||||
{* faire une boucle foreach *}
|
||||
{/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.12 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.13 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.function.include">
|
||||
<title>{include}</title>
|
||||
@@ -170,6 +170,7 @@
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.function.include.php">{include_php}</link>,
|
||||
<link linkend="language.function.insert">{insert}</link>,
|
||||
<link linkend="language.function.php">{php}</link>,
|
||||
<link linkend="template.resources">les ressources de template</link> et
|
||||
<link linkend="tips.componentized.templates">les templates composants</link>.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.10 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.11 Maintainer: gerald Status: ready -->
|
||||
|
||||
<sect1 id="language.function.ldelim">
|
||||
<title>{ldelim},{rdelim}</title>
|
||||
@@ -20,17 +20,17 @@
|
||||
{ldelim}nomFonction{rdelim} est la fa<66>on dont sont appel<65>es les fonctions dans Smarty !
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<para>
|
||||
Affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
{nomFonction} est la fa<66>on dont sont appel<65>es les fonctions dans Smarty !
|
||||
]]>
|
||||
</screen>
|
||||
</screen>
|
||||
|
||||
<para>Un autre exemple avec du javascript</para>
|
||||
<programlisting>
|
||||
<para>Un autre exemple avec du javascript</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<script language="JavaScript">
|
||||
function foo() {ldelim}
|
||||
@@ -38,11 +38,11 @@
|
||||
{rdelim}
|
||||
</script>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
affichera :
|
||||
</para>
|
||||
<screen>
|
||||
</programlisting>
|
||||
<para>
|
||||
affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<script language="JavaScript">
|
||||
function foo() {
|
||||
@@ -50,14 +50,28 @@
|
||||
}
|
||||
</script>
|
||||
]]>
|
||||
</screen>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi la
|
||||
<link linkend="language.escaping">d<EFBFBD>sactivation de l'analyse de Smarty</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
<example>
|
||||
<title>un autre exemple avec Javascript</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
function myJsFunction(){ldelim}
|
||||
alert("Le nom du serveur\n{$smarty.server.SERVER_NAME}\n{$smarty.server.SERVER_ADDR}");
|
||||
{rdelim}
|
||||
</script>
|
||||
<a href="javascript:myJsFunction()">Cliquez ici pour des informations sur le serveur</a>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.function.literal">{literal}</link> et
|
||||
la <link linkend="language.escaping">d<EFBFBD>sactivation de l'analyse de Smarty</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.9 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.11 Maintainer: gerald Status: ready -->
|
||||
|
||||
<sect1 id="language.function.literal">
|
||||
<title>{literal}</title>
|
||||
@@ -36,14 +36,52 @@
|
||||
|
||||
</script>
|
||||
{/literal}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Exemple avec Javascript</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
{literal}
|
||||
function myJsFunction(name, ip){
|
||||
alert("Le nom du serveur\n" + name + "\n" + ip);
|
||||
}
|
||||
{/literal}
|
||||
</script>
|
||||
<a href="javascript:myJsFunction('{$smarty.server.SERVER_NAME}','{$smarty.server.SERVER_ADDR}')">Cliquez ici pour plus d'informations sur le serveur</a>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Un peu de css dans un template</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* inclure ce style... comme une exp<78>rimentation ! *}
|
||||
<style type="text/css">
|
||||
{literal}
|
||||
/* C'est une id<69>e int<6E>ressante pour cette section */
|
||||
.madIdea{
|
||||
border: 3px outset #ffffff;
|
||||
margin: 2 3 4 5px;
|
||||
background-color: #001122;
|
||||
}
|
||||
{/literal}
|
||||
</style>
|
||||
<div class="madIdea">Avec Smarty, vous pouvez inclure du css dans le template</div>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi la
|
||||
<link linkend="language.escaping">d<EFBFBD>sactivation de l'analyse de Smarty</link>.
|
||||
Voir aussi
|
||||
<link linkend="language.function.ldelim">{ldelim}, {rdelim}</link> et
|
||||
la <link linkend="language.escaping">d<EFBFBD>sactivation de l'analyse de Smarty</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.11 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.function.fetch">
|
||||
<title>{fetch}</title>
|
||||
@@ -16,7 +16,7 @@
|
||||
<para>
|
||||
Vous pouvez sp<73>cifier l'attribut optionnel "assign"
|
||||
qui d<>fini une variable de template dans laquelle la sortie
|
||||
sera stock<63>e plut<75>t que d'<27>tre affich<63>e (nouveau dans Smarty 1.5.0).
|
||||
sera stock<63>e plut<75>t que d'<27>tre affich<63>e.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
@@ -63,28 +63,30 @@
|
||||
<note>
|
||||
<title>Note technique</title>
|
||||
<para>
|
||||
Si la s<EFBFBD>curit<EFBFBD> est activ<69>e, vous ne pourez r<>cup<75>rer les
|
||||
fichiers du syst<73>me local que s'ils sont situ<74>s dans l'un des
|
||||
r<EFBFBD>pertoires s<>curis<69> (<link linkend="variable.secure.dir">$secure_dir</link>).
|
||||
Si la <link linkend="variable.security">s<EFBFBD>curit<EFBFBD></link> est activ<69>e,
|
||||
vous ne pourez r<>cup<75>rer les fichiers du syst<73>me local que s'ils sont
|
||||
situ<EFBFBD>s dans l'un des <link linkend="variable.secure.dir">r<EFBFBD>pertoires s<>curis<69></link>.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>fetch</title>
|
||||
<title>Exempe avec {fetch}</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* Inclus du javascript dans votre template *}
|
||||
{fetch file="/export/httpd/www.example.com/docs/navbar.js"}
|
||||
{fetch file='/export/httpd/www.example.com/docs/navbar.js'}
|
||||
|
||||
{* r<>cup<75>re les informations m<>t<EFBFBD>o d'un autre site sur votre page *}
|
||||
{fetch file="http://www.myweather.com/68502/"}
|
||||
{fetch file='http://www.myweather.com/68502/'}
|
||||
|
||||
{* r<>cup<75>re les titres depuis un fichier ftp *}
|
||||
{fetch file="ftp://user:password@ftp.example.com/path/to/currentheadlines.txt"}
|
||||
{fetch file='ftp://user:password@ftp.example.com/path/to/currentheadlines.txt'}
|
||||
{* comme ci-dessus mais avec des variables *}
|
||||
{fetch file="ftp://`$user`:`$password`@`$server`/`$path`"}
|
||||
|
||||
{* assigne le contenu r<>cup<75>r<EFBFBD> <20> une variable de template *}
|
||||
{fetch file="http://www.myweather.com/68502/" assign="weather"}
|
||||
{if $weather ne ""}
|
||||
<b>{$weather}</b>
|
||||
{fetch file='http://www.myweather.com/68502/' assign='weather'}
|
||||
{if $weather ne ''}
|
||||
<div id="weather">{$weather}</div>
|
||||
{/if}
|
||||
]]>
|
||||
</programlisting>
|
||||
@@ -92,6 +94,7 @@
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.function.capture">{capture}</link>,
|
||||
<link linkend="language.function.assign">{assign}</link>
|
||||
<link linkend="language.function.eval">{eval}</link> et
|
||||
<link linkend="api.fetch">fetch()</link>.
|
||||
</para>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.11 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.14 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.function.html.checkboxes">
|
||||
<title>{html_checkboxes}</title>
|
||||
@@ -10,7 +10,7 @@
|
||||
qui cr<63>e un groupe de cases <20> cocher avec les donn<6E>es fournies. Elle prend
|
||||
en compte la liste des <20>l<EFBFBD>ments s<>lectionn<6E>s par d<>faut. Les attributs requis
|
||||
sont values et output, <20> moins que vous n'utilisiez options <20> la place.
|
||||
La sortie g<>n<EFBFBD>r<EFBFBD>e est compatible XHTML.
|
||||
La sortie g<>n<EFBFBD>r<EFBFBD>e est conforme au XHTML.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
@@ -84,6 +84,13 @@
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>ajoute la balise <label>- <20> la sortie</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>assigne la sortie <20> un tableau dont chaque checkbox est un <20>l<EFBFBD>ment.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
@@ -114,8 +121,8 @@ $smarty->assign('customer_id', 1001);
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_checkboxes name="id" values=$cust_ids output=$cust_names
|
||||
selected=$customer_id separator="<br />"}
|
||||
{html_checkboxes name='id' values=$cust_ids output=$cust_names
|
||||
selected=$customer_id separator='<br />'}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
@@ -141,7 +148,8 @@ $smarty->assign('customer_id', 1001);
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_checkboxes name="id" options=$cust_checkboxes selected=$customer_id separator="<br />"}
|
||||
{html_checkboxes name='id' options=$cust_checkboxes
|
||||
selected=$customer_id separator='<br />'}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
@@ -165,10 +173,10 @@ $smarty->assign('customer_id', 1001);
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$sql = 'select type_id, types from types order by type';
|
||||
$smarty->assign('types',$db->getAssoc($sql));
|
||||
$sql = 'select type_id, types from contact_types order by type';
|
||||
$smarty->assign('contact_types',$db->getAssoc($sql));
|
||||
|
||||
$sql = 'select * from contacts where contact_id=12';
|
||||
$sql = 'select contact_id, contact_type, contact from contacts where contact_id=12';
|
||||
$smarty->assign('contact',$db->getRow($sql));
|
||||
|
||||
?>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.function.html.image">
|
||||
<title>{html_image}</title>
|
||||
@@ -109,9 +109,9 @@
|
||||
<![CDATA[
|
||||
O<EFBFBD> index.tpl est :
|
||||
-------------------
|
||||
{html_image file="pumpkin.jpg"}
|
||||
{html_image file="/path/from/docroot/pumpkin.jpg"}
|
||||
{html_image file="../path/relative/to/currdir/pumpkin.jpg"}
|
||||
{html_image file='pumpkin.jpg'}
|
||||
{html_image file='/path/from/docroot/pumpkin.jpg'}
|
||||
{html_image file='../path/relative/to/currdir/pumpkin.jpg'}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.12 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.13 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.function.html.options">
|
||||
<title>{html_options}</title>
|
||||
@@ -163,10 +163,10 @@ $smarty->assign('customer_id', 1001);
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$sql = 'select type_id, types from types order by type';
|
||||
$smarty->assign('types',$db->getAssoc($sql));
|
||||
$sql = 'select type_id, types from contact_types order by type';
|
||||
$smarty->assign('contact_types',$db->getAssoc($sql));
|
||||
|
||||
$sql = 'select contact_id, name, email, type_id
|
||||
$sql = 'select contact_id, name, email, contact_type_id
|
||||
from contacts where contact_id='.$contact_id;
|
||||
$smarty->assign('contact',$db->getRow($sql));
|
||||
|
||||
@@ -180,7 +180,7 @@ $smarty->assign('contact',$db->getRow($sql));
|
||||
<![CDATA[
|
||||
<select name="type_id">
|
||||
<option value='null'>-- none --</option>
|
||||
{html_options name="type" options=$types selected=$contact.type_id}
|
||||
{html_options name='contact_type' options=$contact_types selected=$contact.type_id}
|
||||
</select>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.11 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.14 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.function.html.radios">
|
||||
<title>{html_radios}</title>
|
||||
@@ -10,7 +10,7 @@
|
||||
qui cr<63>e des boutons radio html <20> partir des donn<6E>es fournies. Elle prend en
|
||||
charge les <20>l<EFBFBD>ments s<>lectionn<6E>s par d<>faut. Les attributs requis sont values
|
||||
et output, <20> moins que vous n'utilisiez options <20> la place. La sortie g<>n<EFBFBD>r<EFBFBD>e est
|
||||
compatible XHTML.
|
||||
conforme au XHTML.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
@@ -108,8 +108,8 @@ $smarty->assign('customer_id', 1001);
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_radios name="id" values=$cust_ids output=$cust_names
|
||||
selected=$customer_id separator="<br />"}
|
||||
{html_radios name='id' values=$cust_ids output=$cust_names
|
||||
selected=$customer_id separator='<br />'}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
@@ -134,7 +134,8 @@ $smarty->assign('customer_id', 1001);
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_radios name="id" options=$cust_radios selected=$customer_id separator="<br />"}
|
||||
{html_radios name='id' options=$cust_radios
|
||||
selected=$customer_id separator='<br />'}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
@@ -151,15 +152,15 @@ $smarty->assign('customer_id', 1001);
|
||||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title>{html_radios} - Exemple avec une base de donn<6E>es (eg PEAR ou ADODB):</title>
|
||||
<title>{html_radios} - Exemple avec une base de donn<6E>es (e.g. PEAR ou ADODB):</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$sql = 'select type_id, types from types order by type';
|
||||
$sql = 'select type_id, types from contact_types order by type';
|
||||
$smarty->assign('types',$db->getAssoc($sql));
|
||||
|
||||
$sql = 'select contact_id, name, email, type_id
|
||||
$sql = 'select contact_id, name, email, contact_type_id
|
||||
from contacts where contact_id='.$contact_id;
|
||||
$smarty->assign('contact',$db->getRow($sql));
|
||||
|
||||
@@ -171,7 +172,8 @@ $smarty->assign('contact',$db->getRow($sql));
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_radios name="type" options=$types selected=$contact.type_id separator="<br />"}
|
||||
{html_radios name='contact_type_id' options=$types
|
||||
selected=$contact.contact_type_id separator='<br />'}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.function.mailto">
|
||||
<title>{mailto}</title>
|
||||
@@ -108,13 +108,13 @@
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>{mailto}</title>
|
||||
<title>Exemple avec {mailto}</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{mailto address="moi@example.com"}
|
||||
<a href="mailto:moi@example.com" >moi@example.com</a>
|
||||
|
||||
{mailto address="moi@example.com" text="envoie-moi un email"}
|
||||
{mailto address="moi@example.com" text="envoie moi un email"}
|
||||
<a href="mailto:moi@example.com" >envoie-moi un email</a>
|
||||
|
||||
{mailto address="moi@example.com" encode="javascript"}
|
||||
@@ -136,10 +136,10 @@
|
||||
|
||||
{mailto address="moi@example.com" encode="javascript_charcode"}
|
||||
<script type="text/javascript" language="javascript">
|
||||
<!--
|
||||
{document.write(String.fromCharCode(60,97, ... coup<75> ....60,47,97,62))}
|
||||
//-->
|
||||
</script>
|
||||
<!--
|
||||
{document.write(String.fromCharCode(60,97, ... coup<75> ....60,47,97,62))}
|
||||
//-->
|
||||
</script>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.function.popup.init">
|
||||
<title>{popup_init}</title>
|
||||
@@ -24,7 +24,7 @@
|
||||
<![CDATA[
|
||||
<head>
|
||||
{* popup_init doit <20>tre appel<65> une fois en d<>but de page. *}
|
||||
{popup_init src="/javascripts/overlib.js"}
|
||||
{popup_init src='/javascripts/overlib.js'}
|
||||
</head>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.function.popup">
|
||||
<title>{popup}</title>
|
||||
@@ -371,7 +371,7 @@
|
||||
sur cette fonction.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>timeout</entry>
|
||||
<entry>function</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
@@ -412,18 +412,25 @@
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* popup_init doit <20>tre appel<65> en haut de votre page *}
|
||||
{popup_init src="/javascripts/overlib.js"}
|
||||
{popup_init src='/javascripts/overlib.js'}
|
||||
|
||||
{* cr<63>ation d'un lien avec une popup qui apparait sur l'<27>v<EFBFBD>nement onMouseOver *}
|
||||
<A href="mypage.html" {popup text="Ce lien vous am<61>ne sur ma page!"}>mypage</A>
|
||||
<A href="mypage.html" {popup text='Ce lien vous am<61>ne sur ma page!'}>mypage</A>
|
||||
|
||||
{* vous pouvez utiliser du html, des liens, etc. dans vos popup *}
|
||||
<a href="mypage.html" {popup sticky=true caption="mypage contents"
|
||||
<a href="mypage.html" {popup sticky=true caption='Contenu de la page'
|
||||
text="<ul><li>links</li><li>pages</li><li>images</li></ul>"
|
||||
snapx=10 snapy=10}>mypage</a>
|
||||
snapx=10 snapy=10 trigger='onClick'}>ma page</a>
|
||||
|
||||
{* un popup via une cellule du tableau *}
|
||||
<tr><td {popup caption='D<>tails de cette partie' text=$part_long_description}>{$part_number}</td></tr>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Il y a <20>galement un autre bon exemple sur la page de la documentation de
|
||||
<link linkend="language.function.capture">{capture}</link>.
|
||||
</para>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.function.popup.init">{popup_init}</link> et
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.10 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.escape">
|
||||
<title>escape</title>
|
||||
@@ -33,8 +33,14 @@
|
||||
<entry>1</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><literal>html</literal>,<literal>htmlall</literal>,<literal>url</literal>,<literal>urlpathinfo</literal>,<literal>quotes</literal>,<literal>hex</literal>,<literal>hexentity</literal>,<literal>javascript</literal></entry>
|
||||
<entry><literal>html</literal></entry>
|
||||
<entry>
|
||||
<literal>html</literal>,<literal>htmlall</literal>,
|
||||
<literal>url</literal>,<literal>urlpathinfo</literal>,
|
||||
<literal>quotes</literal>,<literal>hex</literal>,
|
||||
<literal>hexentity</literal>,<literal>javascript</literal>,
|
||||
<literal>mail</literal>
|
||||
</entry>
|
||||
<entry><literal>html</literal></entry>
|
||||
<entry>Format d'<27>chappement <20> utiliser.</entry>
|
||||
</row>
|
||||
<row>
|
||||
@@ -46,27 +52,27 @@
|
||||
</entry>
|
||||
<entry><literal>ISO-8859-1</literal></entry>
|
||||
<entry>Le jeu de caract<63>res pass<73> <20> htmlentities()</entry>
|
||||
</row>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<example>
|
||||
<title>escape</title>
|
||||
<programlisting role="php">
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty->assign('articleTitle',
|
||||
"'Stiff Opposition Expected to Casketless Funeral Plan'"
|
||||
);
|
||||
|
||||
"'Stiff Opposition Expected to Casketless Funeral Plan'"
|
||||
);
|
||||
$smarty->assign('EmailAddress','smarty@example.com');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<EFBFBD> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<EFBFBD> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$titreArticle}
|
||||
{$titreArticle|escape}
|
||||
@@ -75,12 +81,13 @@ O
|
||||
{$titreArticle|escape:"url"}
|
||||
{$titreArticle|escape:"quotes"}
|
||||
<a href="mailto:{$EmailAddress|escape:"hex"}">{$EmailAddress|escape:"hexentity"}</a>
|
||||
{$EmailAddress|escape:'mail'}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ce qui donne <20> l'<27>cran:
|
||||
</para>
|
||||
<screen>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ce qui donne <20> l'<27>cran :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
'Stiff Opposition Expected to Casketless Funeral Plan'
|
||||
&#039;Stiff Opposition Expected to Casketless Funeral Plan&#039;
|
||||
@@ -89,14 +96,24 @@ Ce qui donne
|
||||
%27Stiff+Opposition+Expected+to+Casketless+Funeral+Plan%27
|
||||
\'Stiff Opposition Expected to Casketless Funeral Plan\'
|
||||
<a href="mailto:%62%6f%..snip..%65%74">bob..snip..et</a>
|
||||
smarty [AT] example [DOT] com
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi la
|
||||
<link linkend="language.escaping">d<EFBFBD>sactivation de l'analyse de Smarty</link> et
|
||||
le <link linkend="tips.obfuscating.email">mascage des adresses E-mail</link>.
|
||||
</para>
|
||||
</screen>
|
||||
<para>
|
||||
Souvenez-vous que les fonctions natives PHP peuvent <20>tre utilis<69>es en tant que modificateurs.
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
{* On place les variables pass<73>es en get <20> l'emplacement courant *}
|
||||
<a href="{$SCRIPT_NAME}?page=foo&rewind={$smarty.server.REQUEST_URI|urlencode}">click here</a>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi la
|
||||
<link linkend="language.escaping">d<EFBFBD>sactivation de l'analyse de Smarty</link> et
|
||||
le <link linkend="tips.obfuscating.email">mascage des adresses E-mail</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -1,20 +1,19 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.lower">
|
||||
<title>lower</title>
|
||||
<para>
|
||||
Met une variable en minuscules.
|
||||
Met une variable en minuscules. C'est l'<27>quivalent de la fonction PHP
|
||||
<ulink url="&url.php-manual;strtolower">strtolower()</ulink>.
|
||||
</para>
|
||||
<example>
|
||||
<title>lower</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty->assign('TitreArticle', 'Deux Suspects Se Sont Sauv<75>s.');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@@ -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.modifier.strip">
|
||||
<title>strip</title>
|
||||
@@ -50,6 +50,11 @@ Une r
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.function.strip">{strip}</link> et
|
||||
<link linkend="language.modifier.truncate">truncate</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -1,21 +1,20 @@
|
||||
<?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.modifier.upper">
|
||||
<title>upper</title>
|
||||
<para>
|
||||
Met une variable en majuscules.
|
||||
Met une variable en majuscules. C'est l'<27>quivalent de la fonction PHP
|
||||
<ulink url="&url.php-manual;strtoupper">strtoupper()</ulink>.
|
||||
</para>
|
||||
<example>
|
||||
<title>upper</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty->assign('titreArticle', "Si l'attaque n'est pas mise en place
|
||||
rapidement, cel<65> risque de durer longtemps.");
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="variable.secure.dir">
|
||||
<title>$secure_dir</title>
|
||||
@@ -11,6 +11,18 @@
|
||||
<link linkend="language.function.fetch">{fetch}</link> l'utilisent quand
|
||||
la <link linkend="variable.security">s<EFBFBD>curit<EFBFBD></link> est activ<69>e.
|
||||
</para>
|
||||
<example>
|
||||
<title>$secure_dir example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$secure_dirs[] = '/path/to/site/root/templates/';
|
||||
$secure_dirs[] = '/path/to/includes/';
|
||||
$smarty->secure_dir = $secure_dirs;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
la <link linkend="variable.security.settings">configuration pour la s<>curit<69></link>et
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: yannick Status: ready -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="variable.use.sub.dirs">
|
||||
<title>$use_sub_dirs</title>
|
||||
@@ -8,7 +8,7 @@
|
||||
Smarty va cr<63>er des sous-dossiers dans les dossiers
|
||||
<link linkend="variable.compile.dir">templates_c</link> et
|
||||
<link linkend="variable.cache.dir">cache</link>
|
||||
si la variable $use_sub_dirs est d<>fini <20> true.
|
||||
si la variable $use_sub_dirs est d<>fini <20> true (Par d<>faut, vaut false).
|
||||
Dans un environnement o<> il peut y avoir potentiellement des centaines de milliers
|
||||
de fichiers de cr<63><72>s, ceci peut rendre le syst<73>me de fichiers plus rapide.
|
||||
D'un autre c<>t<EFBFBD>, quelques environnements n'acceptent pas que les processus PHP
|
||||
@@ -30,6 +30,9 @@
|
||||
<ulink url="&url.php-manual;features.safe-mode">safe_mode=On</ulink>,
|
||||
raison pour laquelle c'est param<61>trable et que c'est d<>sactiv<69> par d<>faut.
|
||||
</para>
|
||||
<para>
|
||||
$use_sub_dirs=true sous Windows peut causer des probl<62>mes.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<title>Note</title>
|
||||
@@ -39,7 +42,8 @@
|
||||
</note>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="variable.compile.dir">$compile_dir</link> et
|
||||
<link linkend="variable.compile.dir">$compile_dir</link>,
|
||||
<link linkend="variable.compile.id">$compile_id</link> et
|
||||
<link linkend="variable.cache.dir">$cache_dir</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
Reference in New Issue
Block a user