mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
sync with EN
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.capitalize">
|
||||
<title>capitalize</title>
|
||||
<para>
|
||||
Met la premi<6D>re lettre de chaque mot d'une variable en majuscule.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -31,18 +35,13 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Met la premi<6D>re lettre de chaque mot d'une variable en majuscule.
|
||||
</para>
|
||||
<example>
|
||||
<title>Mise en majuscule</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', 'Le nouveau php5 est vraiment performant !');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
@@ -69,11 +68,12 @@ Le Nouveau Php5 Est Vraiment Performant !
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
Voir aussi
|
||||
<link linkend="language.modifier.lower">lower</link> et
|
||||
<link linkend="language.modifier.upper">upper</link>
|
||||
<link linkend="language.modifier.upper">upper</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -93,4 +93,4 @@ End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
-->
|
@@ -1,8 +1,12 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.cat">
|
||||
<title>cat</title>
|
||||
<para>
|
||||
Cette valeur est concat<61>n<EFBFBD>e <20> la variable donn<6E>e.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -30,22 +34,19 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Cette valeur est concat<61>n<EFBFBD>e <20> la variable donn<6E>e.
|
||||
</para>
|
||||
<example>
|
||||
<title>cat</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
<?php
|
||||
|
||||
$smarty->assign('articleTitle', "'Les devins ont pr<70>vus que le monde existera toujours");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ou index.tpl est:
|
||||
Ou le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -56,12 +57,13 @@ $smarty->display('index.tpl');
|
||||
Donne <20> l'<27>cran:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<![CDATA[
|
||||
Les devins ont pr<70>vus que le monde existera toujours demain.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -81,4 +83,4 @@ End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
-->
|
@@ -1,8 +1,12 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.count.characters">
|
||||
<title>count_characters</title>
|
||||
<para>
|
||||
Compte le nombre de caract<63>res dans une variable.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -30,24 +34,19 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Compte le nombre de caract<63>res dans une variable.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_characters</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', 'Vagues de froid li<6C>es <20> la temp<6D>rature.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<> index.tpl est:
|
||||
O<> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -69,9 +68,9 @@ Vagues de froid li
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.modifier.count.paragraphs">count_paragraphs</link>,
|
||||
<link linkend="language.modifier.count.words">count_words</link>,
|
||||
<link linkend="language.modifier.count.sentences">count_sentences</link> et
|
||||
<link linkend="language.modifier.count.words">count_words</link>.
|
||||
<link linkend="language.modifier.count.paragraphs">count_paragraphs</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.count.paragraphs">
|
||||
<title>count_paragraphs</title>
|
||||
<para>
|
||||
@@ -11,14 +12,16 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', 'La guerre apporte la paix, au prix de la vie de certains innocents.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
$smarty->assign('articleTitle',
|
||||
"War Dims Hope for Peace. Child's Death Ruins Couple's Holiday.\n\n
|
||||
Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation."
|
||||
);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<> index.tpl est:
|
||||
O<> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -40,6 +43,7 @@ La guerre apporte la paix, au prix de la vie des innocents.
|
||||
<link linkend="language.modifier.count.words">count_words</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -59,4 +63,4 @@ End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
-->
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.count.sentences">
|
||||
<title>count_sentences</title>
|
||||
<para>
|
||||
@@ -11,16 +12,17 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', 'Deux navires rentrent en
|
||||
collision - Un des deux coule. Des vaches enrag<61>es blessent un fermier <20>
|
||||
coups de haches.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
$smarty->assign('articleTitle',
|
||||
'Two Soviet Ships Collide - One Dies.
|
||||
Enraged Cow Injures Farmer with Axe.'
|
||||
);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<> index.tpl est :
|
||||
O<> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.count.words">
|
||||
<title>count_words</title>
|
||||
<para>
|
||||
@@ -12,15 +13,13 @@
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', 'Un anneau pour les gouverner tous.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<> index.tpl est:
|
||||
O<> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
|
@@ -1,8 +1,21 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.11 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.date.format">
|
||||
<title>date_format</title>
|
||||
<para>
|
||||
Formate une date / heure au format
|
||||
<ulink url="&url.php-manual;strftime">strftime()</ulink> donn<6E>.
|
||||
Les dates peuvent <20>tre pass<73>es <20> smarty en tant que
|
||||
<ulink url="&url.php-manual;function.time">timestamp</ulink> unix,
|
||||
timestamp mysql ou comme cha<68>ne quelconque contenant mois jour ann<6E>e
|
||||
(interpr<70>table par <ulink url="&url.php-manual;strtotime">strtotime()</ulink>).
|
||||
Les concepteurs de templates peuvent utiliser date_format pour contr<74>ler
|
||||
parfaitement le format de sortie de la date.
|
||||
Si la date pass<73>e <20> <command>date_format</command> est vide, et qu'un
|
||||
second param<61>tre est donn<6E>, ce dernier sera utilis<69> comme <20>tant la date <20> formater.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -37,183 +50,192 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
||||
<para>
|
||||
Formate une date / heure au format
|
||||
<ulink url="&url.php-manual;strftime">strftime()</ulink> donn<6E>.
|
||||
Les dates peuvent <20>tre pass<73>es <20> smarty en tant que timestamp unix,
|
||||
timestamp mysql ou comme cha<68>ne quelconque contenant mois jour ann<6E>e
|
||||
(interpr<70>table par <ulink url="&url.php-manual;strtotime">strtotime()</ulink>).
|
||||
Les concepteurs de templates peuvent utiliser date_format pour contr<74>ler
|
||||
parfaitement le format de sortie de la date.
|
||||
Si la date pass<73>e <20> date_format est vide, et qu'un second param<61>tre
|
||||
est donn<6E>, ce dernier sera utilis<69> comme <20>tant la date <20> formater.
|
||||
</para>
|
||||
<example>
|
||||
<title>date_format</title>
|
||||
<programlisting role="php">
|
||||
<note>
|
||||
<para>
|
||||
Depuis Smarty 2.6.10, les valeurs num<75>riques pass<73>es <20> date_format
|
||||
sont <emphasis>toujours</emphasis> (except<70> pour les timestamps mysql, voir
|
||||
ci-dessous) interpr<70>t<EFBFBD>es comme un timestamp Unix.
|
||||
</para>
|
||||
<para>
|
||||
Avant la version 2.6.10 de Smarty, les cha<68>nes num<75>riques qui <20>taient
|
||||
<20>galement analysables par strtotime() en PHP (comme "YYYYMMDD"),
|
||||
<20>taient, parfois, d<>pendament de l'impl<70>mentation de strtotime(),
|
||||
interpr<70>t<EFBFBD>es en tant que des cha<68>nes date et non des timestamps.
|
||||
</para>
|
||||
<para>
|
||||
La seule exception est les timestamps MySQL : Ils sont uniquement num<75>riques
|
||||
et d'une longueur de 14 caract<63>res ("YYYYMMDDHHMMSS"). Les timestamps
|
||||
MySQL ont la priorit<69> sur les timestamps Unix.
|
||||
</para>
|
||||
</note>
|
||||
</para>
|
||||
<example>
|
||||
<title>date_format</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('hier', strtotime('-1 day'));
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<> index.tpl est:
|
||||
</para>
|
||||
<programlisting>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<> le template est (utilisation de <link linkend="language.variables.smarty.now">$smarty.now</link>) :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$smarty.now|date_format}
|
||||
{$smarty.now|date_format:"%A, %B %e, %Y"}
|
||||
{$smarty.now|date_format:"%H:%M:%S"}
|
||||
{$hier|date_format}
|
||||
{$hier|date_format:"%A, %B %e, %Y"}
|
||||
{$hier|date_format:"%H:%M:%S"}
|
||||
{$smarty.now|date_format:"%D"}
|
||||
{$smarty.now|date_format:"%I:%M %p"}
|
||||
{$yesterday|date_format}
|
||||
{$yesterday|date_format:"%A, %B %e, %Y"}
|
||||
{$yesterday|date_format:"%H:%M:%S"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ce qui donne <20> l'<27>cran:
|
||||
</para>
|
||||
<screen>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ce qui donne <20> l'<27>cran:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Feb 6, 2001
|
||||
Tuesday, February 6, 2001
|
||||
14:33:00
|
||||
02/06/01
|
||||
02:33 pm
|
||||
Feb 5, 2001
|
||||
Monday, February 5, 2001
|
||||
14:33:00
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
date_format conversion specifiers:
|
||||
Conversion de <command>date_format</command> :
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
%a - Abr<62>viation du jour de la semaine, selon les param<61>tres locaux.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%A - Nom du jour de la semaine, selon les param<61>tres locaux.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%b - Abr<62>viation du nom du jour, selon les param<61>tres locaux.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%B - Nom complet du mois, selon les param<61>tres locaux.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%c - Pr<50>f<EFBFBD>rences d'affichage selon les param<61>tres locaux.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%C - Si<53>cle, (L'ann<6E>e divis<69>e par 100 et tronqu<71>e comme un entier, de 00 <20> 99)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%d - Jour du mois, en tant que nombre d<>cimal (de 00 <20> 31)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%D - m<>me chose que %m/%d/%y
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%e - Jour du mois en tant que nombre d<>cimal. Un chiffre unique est pr<70>c<EFBFBD>d<EFBFBD> par
|
||||
un espace (de 1 <20> 31)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%g - Position de la semaine dans le si<73>cle [00,99]
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%G - Position de la semaine, incluant le si<73>cle [0000,9999]
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%h - identique <20> %b
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%H - L'heure en tant que d<>cimale, en utilisant une horloge sur 24 (de 00 <20> 23)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%I - L'heure en tant que d<>cimale en utilisant une horloge sur 12 (de 01 to 12)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%j - jour de l'ann<6E>e (de 001 <20> 366)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%k - Heure (horloge sur 24). Les num<75>ros <20> un chiffre sont pr<70>c<EFBFBD>d<EFBFBD>s d'un espace. (de 0 <20> 23)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%l - Heure (horloge sur 12). Les num<75>ros <20> un chiffre sont pr<70>c<EFBFBD>d<EFBFBD>s d'un espace. (de 1 <20> 12)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%m - Mois en tant que nombre d<>cimal (de 01 <20> 12)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%M - Minute en tant que nombre d<>cimal
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%n - Retour chariot (nouvelle ligne).
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%p - soit am soit pm selon l'heure donn<6E>e, ou alors leurs correspondances locales.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%r - heure en notation a.m. et p.m.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%R - Heure au format 24 heures
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%S - Secondes en tant que nombre d<>cimal.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%t - Caract<63>re tabulation.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%T - Heure courante, <20>quivalent <20> %H:%M:%S
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%u - Jour de la semaine en tant que nombre d<>cimal [1,7], ou 1 repr<70>sente le lundi.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%U - Le num<75>ro de la semaine en nombre d<>cimal, utilisant le premier dimanche
|
||||
en tant que premier jour de la premi<6D>re semaine.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%V - Le num<75>ro de la semaine de l'ann<6E>e courante selon la norme ISO 8601:1988,
|
||||
de 01 <20> 53, ou la semaine 1 est la premi<6D>re semaine qui dispose au minimum
|
||||
de 4 jours dans l'ann<6E>e courante et ou Lundi est le premier jour
|
||||
de cette semaine.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%w - Jour de la semaine en tant que nombre d<>cimal, dimanche <20>tant 0
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%W - Le num<75>ro de la semaine de l'ann<6E>e courante en tant que nombre d<>cimal,
|
||||
ou Lundi est le premier jour de la premi<6D>re semaine.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%x - Repr<70>sentation pr<70>f<EFBFBD>r<EFBFBD>e de la date selon les param<61>tres locaux.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%X - Repr<70>sentation pr<70>f<EFBFBD>r<EFBFBD>e de l'heure selon les param<61>tres locaux, sans la
|
||||
date.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%y - L'ann<6E>e en tant que nombre d<>cimal, sans le si<73>cle. (de 00 <20> 99)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%Y - L'ann<6E>e en tant que nombre d<>cimal, avec le si<73>cle.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%Z - Zone horraire, nom ou abr<62>viation
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%% - Un caract<63>re lit<69>ral `%'
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<listitem><para>
|
||||
%a - Abr<62>viation du jour de la semaine, selon les param<61>tres locaux.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%A - Nom du jour de la semaine, selon les param<61>tres locaux.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%b - Abr<62>viation du nom du jour, selon les param<61>tres locaux.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%B - Nom complet du mois, selon les param<61>tres locaux.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%c - Pr<50>f<EFBFBD>rences d'affichage selon les param<61>tres locaux.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%C - Si<53>cle, (L'ann<6E>e divis<69>e par 100 et tronqu<71>e comme un entier, de 00 <20> 99)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%d - Jour du mois, en tant que nombre d<>cimal (de 00 <20> 31)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%D - m<>me chose que %m/%d/%y
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%e - Jour du mois en tant que nombre d<>cimal. Un chiffre unique est pr<70>c<EFBFBD>d<EFBFBD> par
|
||||
un espace (de 1 <20> 31)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%g - Position de la semaine dans le si<73>cle [00,99]
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%G - Position de la semaine, incluant le si<73>cle [0000,9999]
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%h - identique <20> %b
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%H - L'heure en tant que d<>cimale, en utilisant une horloge sur 24 (de 00 <20> 23)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%I - L'heure en tant que d<>cimale en utilisant une horloge sur 12 (de 01 to 12)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%j - jour de l'ann<6E>e (de 001 <20> 366)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%k - Heure (horloge sur 24). Les num<75>ros <20> un chiffre sont pr<70>c<EFBFBD>d<EFBFBD>s d'un espace. (de 0 <20> 23)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%l - Heure (horloge sur 12). Les num<75>ros <20> un chiffre sont pr<70>c<EFBFBD>d<EFBFBD>s d'un espace. (de 1 <20> 12)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%m - Mois en tant que nombre d<>cimal (de 01 <20> 12)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%M - Minute en tant que nombre d<>cimal
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%n - Retour chariot (nouvelle ligne).
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%p - soit am soit pm selon l'heure donn<6E>e, ou alors leurs correspondances locales.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%r - heure en notation a.m. et p.m.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%R - Heure au format 24 heures
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%S - Secondes en tant que nombre d<>cimal.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%t - Caract<63>re tabulation.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%T - Heure courante, <20>quivalent <20> %H:%M:%S
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%u - Jour de la semaine en tant que nombre d<>cimal [1,7], ou 1 repr<70>sente le lundi.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%U - Le num<75>ro de la semaine en nombre d<>cimal, utilisant le premier dimanche
|
||||
en tant que premier jour de la premi<6D>re semaine.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%V - Le num<75>ro de la semaine de l'ann<6E>e courante selon la norme ISO 8601:1988,
|
||||
de 01 <20> 53, ou la semaine 1 est la premi<6D>re semaine qui dispose au minimum
|
||||
de 4 jours dans l'ann<6E>e courante et ou Lundi est le premier jour
|
||||
de cette semaine.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%w - Jour de la semaine en tant que nombre d<>cimal, dimanche <20>tant 0
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%W - Le num<75>ro de la semaine de l'ann<6E>e courante en tant que nombre d<>cimal,
|
||||
ou Lundi est le premier jour de la premi<6D>re semaine.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%x - Repr<70>sentation pr<70>f<EFBFBD>r<EFBFBD>e de la date selon les param<61>tres locaux.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%X - Repr<70>sentation pr<70>f<EFBFBD>r<EFBFBD>e de l'heure selon les param<61>tres locaux, sans la
|
||||
date.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%y - L'ann<6E>e en tant que nombre d<>cimal, sans le si<73>cle. (de 00 <20> 99)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%Y - L'ann<6E>e en tant que nombre d<>cimal, avec le si<73>cle.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%Z - Zone horraire, nom ou abr<62>viation
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%% - Un caract<63>re lit<69>ral `%'
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<note>
|
||||
<title>Note aux d<>veloppeurs</title>
|
||||
<para>
|
||||
date_format est un alias de la fonction
|
||||
PHP <ulink url="&url.php-manual;strftime">strftime()</ulink>.
|
||||
<command>date_format</command> est un alias de la fonction PHP
|
||||
PHP <ulink url="&url.php-manual;strftime">strftime()</ulink>.
|
||||
Il est probable que vous disposiez de plus ou moins d'options
|
||||
disponibles selon le syst<73>me sur lequel PHP a <20>t<EFBFBD> compil<69>.
|
||||
Reportez-vous <20> l'aide de votre syst<73>me pour une liste compl<70>te des
|
||||
@@ -222,8 +244,9 @@ en tant que premier jour de la premi
|
||||
</note>
|
||||
</para>
|
||||
<para>
|
||||
Voir aussi
|
||||
Voir aussi
|
||||
<link linkend="language.variables.smarty.now">$smarty.now</link>,
|
||||
la <ulink url="&url.php-manual;strftime">fonction PHP strftime()</ulink>,
|
||||
<link linkend="language.function.html.select.date">{html_select_date}</link> et
|
||||
les <link linkend="tips.dates">astuces sur les dates</link>.
|
||||
</para>
|
||||
|
@@ -1,8 +1,14 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.default">
|
||||
<title>default</title>
|
||||
<para>
|
||||
Utilis<69> pour d<>finir une valeur par d<>faut <20> une variable.
|
||||
Si la variable est vide ou ind<6E>finie, la valeur donn<6E>e est affich<63>e
|
||||
en lieu et place. Default attends un seul argument.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -31,24 +37,19 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Utilis<69> pour d<>finir une valeur par d<>faut <20> une variable.
|
||||
Si la variable est vide ou ind<6E>finie, la valeur donn<6E>e est affich<63>e
|
||||
en lieu et place. Default attends un seul argument.
|
||||
</para>
|
||||
<example>
|
||||
<title>default</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->assign('TitreArticle', 'Les portes de la moria restent ferm<72>es.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<EFBFBD> index.tpl est :
|
||||
O<EFBFBD> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -70,6 +71,7 @@ pas de titre
|
||||
et <link linkend="tips.blank.var.handling">la gestion de l'effacement des variables</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -89,4 +91,4 @@ End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
-->
|
@@ -1,8 +1,15 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.escape">
|
||||
<title>escape</title>
|
||||
<para>
|
||||
"Echappe" les caract<63>res sp<73>ciaux html, d'url, pour
|
||||
les quotes d'une cha<68>ne, les valeurs
|
||||
hexad<61>cimales, les entit<69>s hexad<61>cimales ou javascript.
|
||||
Par d<>faut, ce param<61>tre est html.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="6">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -34,25 +41,21 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
"Echappe" les caract<63>res sp<73>ciaux html, d'url, pour
|
||||
les quotes d'une cha<68>ne, les valeurs
|
||||
hexad<61>cimales, les entit<69>s hexad<61>cimales ou javascript.
|
||||
Par d<>faut, ce param<61>tre est html.
|
||||
</para>
|
||||
<example>
|
||||
<title>escape</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', "'Stiff Opposition Expected to Casketless Funeral Plan'");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
$smarty->assign('articleTitle',
|
||||
"'Stiff Opposition Expected to Casketless Funeral Plan'"
|
||||
);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<EFBFBD> index.tpl est:
|
||||
O<EFBFBD> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -82,8 +85,8 @@ Ce qui donne
|
||||
</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>.
|
||||
<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>
|
||||
|
||||
|
@@ -1,8 +1,16 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.indent">
|
||||
<title>indent</title>
|
||||
<para>
|
||||
Indente chacune des lignes d'une cha<68>ne. Comme param<61>tre optionnel,
|
||||
vous pouvez sp<73>cifier le nombre de caract<63>res <20> utiliser pour l'indentation (4 par d<>faut).
|
||||
Comme second param<61>tre optionnel, vous
|
||||
pouvez sp<73>cifier le caract<63>re <20> utiliser pour l'indentation (utilisez
|
||||
"\t" pour les tabulations).
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -37,26 +45,22 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Indente chacune des lignes d'une cha<68>ne. Comme param<61>tre optionnel,
|
||||
vous pouvez sp<73>cifier le nombre de caract<63>res <20> utiliser pour l'indentation (4 par d<>faut).
|
||||
Comme second param<61>tre optionnel, vous
|
||||
pouvez sp<73>cifier le caract<63>re <20> utiliser pour l'indentation (utilisez
|
||||
"\t" pour les tabulations).
|
||||
</para>
|
||||
<example>
|
||||
<title>indent</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', 'Il fera noir cette nuit.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
$smarty->assign('articleTitle',
|
||||
'NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.'
|
||||
);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ou index.tpl est:
|
||||
Ou le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -74,20 +78,28 @@ Ce qui donne
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Il fera noir cette nuit.
|
||||
NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.
|
||||
|
||||
Il fera noir cette nuit.
|
||||
NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.
|
||||
|
||||
Il fera noir cette nuit.
|
||||
NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.
|
||||
|
||||
Il fera noir cette nuit.
|
||||
NJ judge to rule on nude beach.
|
||||
Sun or rain expected today, dark tonight.
|
||||
Statistics show that teen pregnancy drops off significantly after 25.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.modifier.strip">strip</link>
|
||||
et <link linkend="language.modifier.spacify">spacify</link>.
|
||||
Voir aussi
|
||||
<link linkend="language.modifier.strip">strip</link> et
|
||||
<link linkend="language.modifier.spacify">spacify</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.lower">
|
||||
<title>lower</title>
|
||||
<para>
|
||||
@@ -11,14 +12,14 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->assign('TitreArticle', 'Deux Suspects Se Sont Sauv<75>s.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<> index.tpl est :
|
||||
O<> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -42,6 +43,7 @@ deux suspects se sont sauv
|
||||
<link linkend="language.modifier.capitalize">Capitalize</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -61,4 +63,4 @@ End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
-->
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.nl2br">
|
||||
<title>nl2br</title>
|
||||
<para>
|
||||
@@ -12,14 +13,16 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', "Pluie ou soleil attendu\naujourd'hui, nuit noire");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
$smarty->assign('articleTitle',
|
||||
"Sun or rain expected\ntoday, dark tonight"
|
||||
);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<EFBFBD> index.tpl est :
|
||||
O<EFBFBD> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -36,7 +39,7 @@ Pluie ou soleil attendu<br />aujourd'hui, nuit noire
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
Voir aussi
|
||||
<link linkend="language.modifier.wordwrap">word_wrap</link>,
|
||||
<link linkend="language.modifier.count.paragraphs">count_paragraphs</link> et
|
||||
<link linkend="language.modifier.count.sentences">count_sentences</link>.
|
||||
|
@@ -1,8 +1,14 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.regex.replace">
|
||||
<title>regex_replace</title>
|
||||
<para>
|
||||
Un rechercher / remplacer avec une expression r<>guli<6C>re. Utilise la m<>me
|
||||
syntaxe que la fonction PHP
|
||||
<ulink url="&url.php-manual;preg_replace">preg_replace()</ulink>.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -37,24 +43,19 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Un rechercher / remplacer avec une expression r<>guli<6C>re. Utilise la m<>me
|
||||
syntaxe que la fonction PHP <ulink
|
||||
url="&url.php-manual;preg_replace">preg_replace()</ulink>.
|
||||
</para>
|
||||
<example>
|
||||
<title>regex_replace</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->assign('TitreArticle', "L'infertilit<69> est un maux grandissant\n, disent les experts.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ou index.tpl est :
|
||||
Ou le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -76,7 +77,7 @@ L'infertilit
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
Voir aussi
|
||||
<link linkend="language.modifier.replace">replace</link> et
|
||||
<link linkend="language.modifier.escape">escape</link>.
|
||||
</para>
|
||||
|
@@ -1,8 +1,13 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.replace">
|
||||
<title>replace</title>
|
||||
<para>
|
||||
Un simple remplacement de cha<68>ne de caract<63>res. Ceci est l'<27>quivalent
|
||||
de la fonction PHP <ulink url="&url.php-manual;str_replace">str_replace()</ulink>.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -37,33 +42,29 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Un simple remplacement de cha<68>ne de caract<63>res. Ceci est l'<27>quivalent
|
||||
dela fonction PHP <ulink url="&url.php-manual;str_replace">str_replace()</ulink>.
|
||||
</para>
|
||||
<example>
|
||||
<title>replace</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->assign('titreArticle', "Child's Stool Great for Use in Garden.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ou index.tpl est :
|
||||
Ou le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$titreArticle}
|
||||
{$titreArticle|replace:"Garden":"Vineyard"}
|
||||
{$titreArticle|replace:" ":" "}
|
||||
{$titreArticle|replace:'Garden':'Vineyard'}
|
||||
{$titreArticle|replace:' ':' '}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ce qui donne en sortie :
|
||||
Ce qui donne en sortie :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
@@ -79,6 +80,7 @@ Child's Stool Great for Use in Garden.
|
||||
<link linkend="language.modifier.escape">escape</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -98,4 +100,4 @@ End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
-->
|
@@ -1,8 +1,14 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.spacify">
|
||||
<title>spacify</title>
|
||||
<para>
|
||||
spacify est un moyen pour ins<6E>rer un espace entre tous les caract<63>res
|
||||
d'une variable. Optionnellement, vous pouvez lui passer un caract<63>re
|
||||
(ou une cha<68>ne) diff<66>rent de l'espace <20> ins<6E>rer.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -30,25 +36,20 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
spacify est un moyen pour ins<6E>rer un espace entre tous les caract<63>res
|
||||
d'une variable. Optionnellement, vous pouvez lui passer un caract<63>re
|
||||
(ou une cha<68>ne) diff<66>rent de espace <20> ins<6E>rer.
|
||||
</para>
|
||||
<example>
|
||||
<title>spacify</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->assign('titreArticle', 'Quelque chose s\'est mal pass<73> et <20> provoqu<71>
|
||||
cet accident, disent les experts');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ou index.tpl est :
|
||||
O<EFBFBD> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
|
@@ -1,8 +1,14 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.string.format">
|
||||
<title>string_format</title>
|
||||
<para>
|
||||
Un moyen pour formater les cha<68>nes de caract<63>res, comme par exemple les
|
||||
nombres d<>cimaux. Utilise la syntaxe de <ulink url="&url.php-manual;sprintf">sprintf()</ulink>
|
||||
pour formater les <20>l<EFBFBD>ments.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -30,24 +36,19 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Un moyen pour formater les cha<68>nes de caract<63>res, comme par exemple les
|
||||
nombres d<>cimaux. Utilise la syntaxe de <ulink url="&url.php-manual;sprintf">sprintf</ulink>
|
||||
pour formater les <20>l<EFBFBD>ments.
|
||||
</para>
|
||||
<example>
|
||||
<title>string_format</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->assign('nombre', 23.5787446);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
ou index.tpl est :
|
||||
o<EFBFBD> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -68,7 +69,7 @@ Ce qui donne en sortie :
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
Voir aussi
|
||||
<link linkend="language.modifier.date.format">date_format</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
@@ -1,8 +1,13 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.strip.tags">
|
||||
<title>strip_tags</title>
|
||||
<para>
|
||||
Supprime toutes les balises, et plus g<>n<EFBFBD>ralement tout ce qui se trouve
|
||||
entre < et >.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -30,43 +35,43 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Supprime toutes les balises, et plus g<>n<EFBFBD>ralement tout ce qui se trouve
|
||||
entre < et >.
|
||||
</para>
|
||||
<example>
|
||||
<title>strip_tags</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', "Une femme aveugle obtient un nouveau <font face=\"helvetica\">rein</font> d'un p<>re qu'elle n'a pas vu depuis <b>des ann<6E>es</b>.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
$smarty->assign('articleTitle',
|
||||
"Blind Woman Gets <font face=\"helvetica\">New
|
||||
Kidney</font> from Dad she Hasn't Seen in <b>years</b>."
|
||||
);
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ou index.tpl est :
|
||||
O<EFBFBD> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$titreArticle}
|
||||
{$titreArticle|strip_tags} {* identique <20> {$titreArticle|strip_tags:true} *}
|
||||
{$titreArticle|strip_tags} {* identique <20> {$titreArticle|strip_tags:true} *}
|
||||
{$titreArticle|strip_tags:false}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ce qui donne en sortie :
|
||||
Ce qui donne en sortie :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Une femme aveugle obtient un nouveau <font face=\"helvetica\">rein</font> d'un p<>re qu'elle n'a pas vu depuis <b>des ann<6E>es</b>.
|
||||
Une femme aveugle obtient un nouveau rein d'un p<>re qu'elle n'a pas vu depuis des ann<6E>es .
|
||||
Une femme aveugle obtient un nouveau rein d'un p<>re qu'elle n'a pas vu depuis des ann<6E>es.
|
||||
Blind Woman Gets <font face="helvetica">New Kidney</font> from Dad she Hasn't Seen in <b>years</b>.
|
||||
Blind Woman Gets New Kidney from Dad she Hasn't Seen in years .
|
||||
Blind Woman Gets New Kidney from Dad she Hasn't Seen in years.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -86,4 +91,4 @@ End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
-->
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.strip">
|
||||
<title>strip</title>
|
||||
<para>
|
||||
@@ -11,8 +12,7 @@
|
||||
<title>Note</title>
|
||||
<para>
|
||||
Si vous voulez r<>aliser cette action sur un bloc complet du template,
|
||||
utilisez la <link
|
||||
linkend="language.function.strip">fonction strip</link>.
|
||||
utilisez la fonction <link linkend="language.function.strip">{strip}</link>.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
@@ -28,27 +28,30 @@ $smarty->display('index.tpl');
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ou index.tpl est :
|
||||
O<EFBFBD> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$titreArticle}
|
||||
{$titreArticle|strip}
|
||||
{$titreArticle|strip:"&nbsp;"}
|
||||
{$titreArticle|strip:" "}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ce qui donne en sortie :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Une r<>union autour
|
||||
d'un feu de chemin<69>e est toujours agr<67>able.
|
||||
Une r<>union autour d'un feu de chemin<69>e est toujours agr<67>able.
|
||||
Une&nbsp;r<>union&nbsp;autour&nbsp;d'un&nbsp;feu&nbsp;de&nbsp;chemin<69>e&nbsp;est&nbsp;toujours
|
||||
&nbsp;agr<67>able.
|
||||
Une r<>union autour d'un feu de chemin<69>e est toujours
|
||||
agr<67>able.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -68,4 +71,4 @@ End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
-->
|
@@ -1,8 +1,18 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.truncate">
|
||||
<title>truncate</title>
|
||||
<para>
|
||||
Tronque une variable <20> une certaine longueur, par d<>faut 80.
|
||||
Un second param<61>tre optionnel permet de sp<73>cifier une cha<68>ne <20> afficher
|
||||
<20> la fin de la variable une fois tronqu<71>e. Les caract<63>res de fin sont
|
||||
inclus dans la longueur de la cha<68>ne <20> tronquer. Par d<>faut,
|
||||
truncate tentera de couper la cha<68>ne <20> la fin d'un mot. Si vous voulez
|
||||
tronquer la cha<68>ne au caract<63>re exact, donnez la valeur true au
|
||||
dernier param<61>tre optionnel.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -33,8 +43,8 @@
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>...</entry>
|
||||
<entry>Le texte <EFBFBD> rajouter lorsque l'on effectue un
|
||||
troncage.</entry>
|
||||
<entry>Le texte qui remplace le texte tronqu<71>. Sa longueur n'est PAS
|
||||
incluse dans la configuration de la longueur <20> tronquer.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>3</entry>
|
||||
@@ -45,31 +55,31 @@
|
||||
le dernier mot (false), ou au caract<63>re exact (true).
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>4</entry>
|
||||
<entry>bool<EFBFBD>en</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Ceci d<>termine si le troncage intervient <20> la fin de la
|
||||
cha<68>ne (false), ou au milieu de la cha<68>ne (true). Notez que si
|
||||
ceci vaut true, alors les limites de mots sont ignor<6F>es.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Tronque une variable <20> une certaine longueur, par d<>faut 80.
|
||||
Un second param<61>tre optionnel permet de sp<73>cifier une cha<68>ne <20> afficher
|
||||
<20> la fin de la variable une fois tronqu<71>e. Les caract<63>res de fin sont
|
||||
inclus dans la longueur de la cha<68>ne <20> tronquer. Par d<>faut,
|
||||
truncate tentera de couper la cha<68>ne <20> la fin d'un mot. Si vous voulez
|
||||
tronquer la cha<68>ne au caract<63>re exact, donnez la valeur true au
|
||||
dernier param<61>tre optionnel.
|
||||
</para>
|
||||
<example>
|
||||
<title>truncate</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->assign('titreArticle', 'Deux soeurs r<>unies apr<70>s 18 ans de s<>paration.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Ou index.tpl est :
|
||||
O<EFBFBD> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -97,6 +107,7 @@ Deux soeurs r
|
||||
</screen>
|
||||
</example>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -116,4 +127,4 @@ End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
-->
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.upper">
|
||||
<title>upper</title>
|
||||
<para>
|
||||
@@ -11,15 +12,15 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->assign('titreArticle', "Si l'attaque n'est pas mise en place
|
||||
rapidement, cel<65> risque de durer longtemps.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
O<> index.tpl est:
|
||||
O<> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -41,6 +42,7 @@ SI L'ATTAQUE N'EST PAS MISE EN PLACE RAPIDEMENT, CEL
|
||||
<link linkend="language.modifier.capitalize">capitalize</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -60,4 +62,4 @@ End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
-->
|
@@ -1,8 +1,18 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
|
||||
|
||||
<sect1 id="language.modifier.wordwrap">
|
||||
<title>wordwrap</title>
|
||||
<para>
|
||||
Ajuste une cha<68>ne de caract<63>res <20> une taille de colonne, par d<>faut 80.
|
||||
Un second param<61>tre optionnel vous permet de sp<73>cifier la cha<68>ne <20> utiliser
|
||||
pour l'ajustement <20> la nouvelle ligne (retour chariot \n par d<>faut).
|
||||
Par d<>faut, wordwrap tente un ajustement <20> la fin d'un mot. Si vous voulez
|
||||
autoriser le d<>coupage des mots pour un ajustement au caract<63>re pr<70>s,
|
||||
passez true au troisi<73>me param<61>tre optionnel. Ceci est l'<27>quivalent de la
|
||||
fonction PHP <ulink url="&url.php-manual;wordwrap">wordwrap()</ulink>.
|
||||
</para>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -45,30 +55,19 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Ajuste une cha<68>ne de caract<63>res <20> une taille de colonne, par d<>faut 80.
|
||||
Un second param<61>tre optionnel vous permet de sp<73>cifier la cha<68>ne <20> utiliser
|
||||
pour l'ajustement <20> la nouvelle ligne (retour chariot \n par d<>faut).
|
||||
Par d<>faut, wordwrap tente un ajustement <20> la fin d'un mot. Si vous voulez
|
||||
autoriser le d<>coupage des mots pour un ajustement au caract<63>re pr<70>s,
|
||||
passez true au troisi<73>me param<61>tre optionnel. Ceci est l'<27>quivalent de la
|
||||
fonction PHP <ulink
|
||||
url="&url.php-manual;wordwrap">wordwrap()</ulink>.
|
||||
</para>
|
||||
<example>
|
||||
<title>wordwrap</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', "Une femme aveugle obtient un nouveau rein
|
||||
d'un p<>re qu'elle n'a pas vu depuis des ann<6E>es.");
|
||||
$smarty->display('index.tpl');
|
||||
$smarty->assign('articleTitle',
|
||||
"Blind woman gets new kidney from dad she hasn't seen in years."
|
||||
);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
o<EFBFBD> index.tpl est :
|
||||
<para>
|
||||
O<EFBFBD> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -113,8 +112,9 @@ n'a pas vu depuis des ann
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
Voir aussi
|
||||
<link linkend="language.modifier.nl2br">nl2br</link>.
|
||||
Voir aussi
|
||||
<link linkend="language.modifier.nl2br">nl2br</link> et
|
||||
<link linkend="language.function.textformat">{textformat}</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
|
Reference in New Issue
Block a user