Files
smarty/docs/en/designers/language-combining-modifiers.xml

56 lines
1.6 KiB
XML
Raw Normal View History

2004-03-28 15:15:38 +00:00
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<chapter id="language.combining.modifiers">
<title>Combining Modifiers</title>
<para>
You can apply any number of modifiers to a variable. They will be
applied in the order they are combined, from left to right. They must
be separated with a <literal>|</literal> (pipe) character.
</para>
<example>
<title>combining modifiers</title>
<programlisting>
index.php:
$smarty = new Smarty;
$smarty-&gt;assign('articleTitle', 'Smokers are Productive, but Death Cuts Efficiency.');
$smarty-&gt;display('index.tpl');
index.tpl:
{$articleTitle}
{$articleTitle|upper|spacify}
{$articleTitle|lower|spacify|truncate}
{$articleTitle|lower|truncate:30|spacify}
{$articleTitle|lower|spacify|truncate:30:". . ."}
OUTPUT:
Smokers are Productive, but Death Cuts Efficiency.
S M O K E R S A R E P R O D U C T I V E , B U T D E A T H C U T S E F F I C I E N C Y .
s m o k e r s a r e p r o d u c t i v e , b u t d e a t h c u t s...
s m o k e r s a r e p r o d u c t i v e , b u t . . .
s m o k e r s a r e p. . .</programlisting>
</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
-->