2004-04-13 15:43:47 +00:00
|
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
|
|
|
|
<!-- $Revision$ -->
|
2006-10-03 20:20:06 +00:00
|
|
|
|
<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready -->
|
2005-12-04 20:09:57 +00:00
|
|
|
|
|
2004-05-23 15:50:53 +00:00
|
|
|
|
<sect1 id="language.modifier.truncate">
|
|
|
|
|
|
<title>truncate</title>
|
2005-12-04 20:09:57 +00:00
|
|
|
|
<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,
|
2006-10-03 20:20:06 +00:00
|
|
|
|
<varname>truncate</varname> 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
|
2005-12-04 20:09:57 +00:00
|
|
|
|
dernier param<61>tre optionnel.
|
|
|
|
|
|
</para>
|
2004-05-23 15:50:53 +00:00
|
|
|
|
<informaltable frame="all">
|
|
|
|
|
|
<tgroup cols="5">
|
|
|
|
|
|
<colspec colname="param" align="center" />
|
|
|
|
|
|
<colspec colname="type" align="center" />
|
|
|
|
|
|
<colspec colname="required" align="center" />
|
|
|
|
|
|
<colspec colname="default" align="center" />
|
|
|
|
|
|
<colspec colname="desc"/>
|
|
|
|
|
|
<thead>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>Position du param<61>tre</entry>
|
|
|
|
|
|
<entry>Type</entry>
|
|
|
|
|
|
<entry>Requis</entry>
|
|
|
|
|
|
<entry>Defaut</entry>
|
|
|
|
|
|
<entry>Description</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
</thead>
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>1</entry>
|
|
|
|
|
|
<entry>entier</entry>
|
|
|
|
|
|
<entry>Non</entry>
|
|
|
|
|
|
<entry>80</entry>
|
|
|
|
|
|
<entry>Le nombre de caract<63>res maximums au-del<65> duquel
|
|
|
|
|
|
on effectue le troncage</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>2</entry>
|
|
|
|
|
|
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
|
|
|
|
|
<entry>Non</entry>
|
|
|
|
|
|
<entry>...</entry>
|
2005-12-04 20:09:57 +00:00
|
|
|
|
<entry>Le texte qui remplace le texte tronqu<71>. Sa longueur n'est PAS
|
|
|
|
|
|
incluse dans la configuration de la longueur <20> tronquer.</entry>
|
2004-05-23 15:50:53 +00:00
|
|
|
|
</row>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>3</entry>
|
|
|
|
|
|
<entry>bool<EFBFBD>en</entry>
|
|
|
|
|
|
<entry>Non</entry>
|
2006-10-03 20:20:06 +00:00
|
|
|
|
<entry>&false;</entry>
|
2004-05-23 15:50:53 +00:00
|
|
|
|
<entry>D<EFBFBD>termine si le troncage est effectu<74> sur
|
2006-10-03 20:20:06 +00:00
|
|
|
|
le dernier mot (&false;), ou au caract<63>re exact (&true;).
|
2004-05-23 15:50:53 +00:00
|
|
|
|
</entry>
|
|
|
|
|
|
</row>
|
2005-12-04 20:09:57 +00:00
|
|
|
|
<row>
|
|
|
|
|
|
<entry>4</entry>
|
|
|
|
|
|
<entry>bool<EFBFBD>en</entry>
|
|
|
|
|
|
<entry>Non</entry>
|
2006-10-03 20:20:06 +00:00
|
|
|
|
<entry>&false;</entry>
|
2005-12-04 20:09:57 +00:00
|
|
|
|
<entry>Ceci d<>termine si le troncage intervient <20> la fin de la
|
2006-10-03 20:20:06 +00:00
|
|
|
|
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>
|
2005-12-04 20:09:57 +00:00
|
|
|
|
</row>
|
2004-05-23 15:50:53 +00:00
|
|
|
|
</tbody>
|
|
|
|
|
|
</tgroup>
|
|
|
|
|
|
</informaltable>
|
|
|
|
|
|
<example>
|
|
|
|
|
|
<title>truncate</title>
|
2004-07-04 09:39:39 +00:00
|
|
|
|
<programlisting role="php">
|
|
|
|
|
|
<![CDATA[
|
|
|
|
|
|
<?php
|
2005-12-04 20:09:57 +00:00
|
|
|
|
|
2004-07-04 09:39:39 +00:00
|
|
|
|
$smarty->assign('titreArticle', 'Deux soeurs r<>unies apr<70>s 18 ans de s<>paration.');
|
2005-12-04 20:09:57 +00:00
|
|
|
|
|
2004-07-04 09:39:39 +00:00
|
|
|
|
?>
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
|
|
|
|
|
<para>
|
2005-12-04 20:09:57 +00:00
|
|
|
|
O<EFBFBD> le template est :
|
2004-07-04 09:39:39 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
<programlisting>
|
|
|
|
|
|
<![CDATA[
|
2004-04-13 15:43:47 +00:00
|
|
|
|
{$titreArticle}
|
|
|
|
|
|
{$titreArticle|truncate}
|
|
|
|
|
|
{$titreArticle|truncate:30}
|
|
|
|
|
|
{$titreArticle|truncate:30:""}
|
|
|
|
|
|
{$titreArticle|truncate:30:"---"}
|
|
|
|
|
|
{$titreArticle|truncate:30:"":true}
|
|
|
|
|
|
{$titreArticle|truncate:30:"...":true}
|
2006-04-09 21:59:55 +00:00
|
|
|
|
{$articleTitle|truncate:30:'..':true:true}
|
2004-07-04 09:39:39 +00:00
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Ce qui donne en sortie :
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<screen>
|
|
|
|
|
|
<![CDATA[
|
2004-04-13 15:43:47 +00:00
|
|
|
|
Deux soeurs r<>unies apr<70>s 18 ans de s<>paration.
|
|
|
|
|
|
Deux soeurs r<>unies apr<70>s...
|
|
|
|
|
|
Deux soeurs r<>unies apr<70>s
|
|
|
|
|
|
Deux soeurs r<>unies apr<70>s---
|
|
|
|
|
|
Deux soeurs r<>unies apr<70>s 18 a
|
|
|
|
|
|
Deux soeurs r<>unies apr<70>s 1...
|
2006-04-09 21:59:55 +00:00
|
|
|
|
Deux soeurs ... de s<>paration.
|
2004-07-04 09:39:39 +00:00
|
|
|
|
]]>
|
|
|
|
|
|
</screen>
|
2004-05-23 15:50:53 +00:00
|
|
|
|
</example>
|
2004-04-13 15:43:47 +00:00
|
|
|
|
</sect1>
|
2005-12-04 20:09:57 +00:00
|
|
|
|
|
2004-04-13 15:43:47 +00:00
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
|
|
Local variables:
|
|
|
|
|
|
mode: sgml
|
|
|
|
|
|
sgml-omittag:t
|
|
|
|
|
|
sgml-shorttag:t
|
|
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
|
|
sgml-indent-step:1
|
|
|
|
|
|
sgml-indent-data:t
|
|
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
|
|
sgml-parent-document:nil
|
|
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
|
|
End:
|
|
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
|
|
vi: ts=1 sw=1
|
2005-12-04 20:09:57 +00:00
|
|
|
|
-->
|