mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-02 05:11:36 +01:00
70 lines
1.9 KiB
XML
70 lines
1.9 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 1.6 Maintainer: gerald Status: ready -->
|
|
<chapter id="language.combining.modifiers">
|
|
<title>Combiner des modificateurs de variable.</title>
|
|
<para>
|
|
Vous pouvez appliquer un nombre quelquonque de modificateurs à une variable.
|
|
Ils seront invoqués dans l'ordre d'apparition, de la gauche vers la droite.
|
|
Ils doivent être séparés par un <literal>|</literal> (pipe).
|
|
</para>
|
|
<example>
|
|
<title>Combiner des modificateurs</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$smarty->assign('titreArticle', 'Les fumeurs sont productifs, mais la mort
|
|
tue l\'efficacitée.');
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Où le template est :
|
|
</para>
|
|
<programlisting>
|
|
<![CDATA[
|
|
{$titreArticle}
|
|
{$titreArticle|upper|spacify}
|
|
{$titreArticle|lower|spacify|truncate}
|
|
{$titreArticle|lower|truncate:30|spacify}
|
|
{$titreArticle|lower|spacify|truncate:30:". . ."}
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Celà va afficher :
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
Les fumeurs sont productifs, mais la mort tue l'efficacitée.
|
|
L E S F U M E U R S S O N T P R O D U C T I F S , M A I S L A M O R T T U E L ' E F F I C A C I T É E .
|
|
L E S F U M E U R S S O N T P R O D U C T I F S , M A I S L A M...
|
|
L E S F U M E U R S S O N T P R O D U C T I F S , M A I S L A M...
|
|
L e s f u m e u r s s o n t p r o d u c t i f s , . . .
|
|
L e s f u m e u r s s. . .
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</chapter>
|
|
|
|
<!-- 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
|
|
--> |