Files
smarty/docs/fr/designers/language-modifiers/language-modifier-replace.xml

103 lines
2.4 KiB
XML
Raw Normal View History

2004-04-13 15:43:47 +00:00
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
2005-12-04 20:09:57 +00:00
<!-- EN-Revision: 1.5 Maintainer: yannick Status: ready -->
2004-05-23 15:50:53 +00:00
<sect1 id="language.modifier.replace">
<title>replace</title>
2005-12-04 20:09:57 +00:00
<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>
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>cha<EFBFBD>ne de caract<63>res</entry>
<entry>Oui</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>cha<EFBFBD>ne <20> remplacer.</entry>
</row>
<row>
<entry>2</entry>
<entry>cha<EFBFBD>ne de caract<63>res</entry>
<entry>Oui</entry>
<entry><emphasis>n/a</emphasis></entry>
<entry>cha<EFBFBD>ne de remplacement.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<example>
<title>replace</title>
<programlisting role="php">
<![CDATA[
<?php
2005-12-04 20:09:57 +00:00
$smarty->assign('titreArticle', "Child's Stool Great for Use in Garden.");
2005-12-04 20:09:57 +00:00
?>
]]>
</programlisting>
<para>
2005-12-04 20:09:57 +00:00
Ou le template est :
</para>
<programlisting>
<![CDATA[
2004-04-13 15:43:47 +00:00
{$titreArticle}
2005-12-04 20:09:57 +00:00
{$titreArticle|replace:'Garden':'Vineyard'}
{$titreArticle|replace:' ':' '}
]]>
</programlisting>
<para>
2005-12-04 20:09:57 +00:00
Ce qui donne en sortie :
</para>
<screen>
<![CDATA[
2004-04-13 15:43:47 +00:00
Child's Stool Great for Use in Garden.
Child's Stool Great for Use in Vineyard.
Child's Stool Great for Use in Garden.
]]>
</screen>
2005-05-24 22:13:50 +00:00
</example>
<para>
Voir aussi
<link linkend="language.modifier.regex.replace">regex_replace</link> et
<link linkend="language.modifier.escape">escape</link>.
</para>
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
-->