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

68 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$ -->
2004-04-18 17:30:04 +00:00
<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 role="php">
2004-04-14 15:53:39 +00:00
<![CDATA[
<?php
2004-03-28 15:15:38 +00:00
$smarty->assign('articleTitle', 'Smokers are Productive, but Death Cuts Efficiency.');
2004-03-28 15:15:38 +00:00
?>
]]>
</programlisting>
<para>
where template is:
</para>
<programlisting>
<![CDATA[
2004-03-28 15:15:38 +00:00
{$articleTitle}
{$articleTitle|upper|spacify}
{$articleTitle|lower|spacify|truncate}
{$articleTitle|lower|truncate:30|spacify}
{$articleTitle|lower|spacify|truncate:30:". . ."}
2004-04-14 15:53:39 +00:00
]]>
2004-04-18 17:30:04 +00:00
</programlisting>
<para>
The above example will output:
</para>
<screen>
2004-04-14 15:53:39 +00:00
<![CDATA[
2004-03-28 15:15:38 +00:00
Smokers are Productive, but Death Cuts Efficiency.
2005-05-21 12:41:15 +00:00
S M O K E R S A R ....snip.... H C U T S E F F I C I E N C Y .
s m o k e r s a r ....snip.... b u t d e a t h c u t s...
2004-03-28 15:15:38 +00:00
s m o k e r s a r e p r o d u c t i v e , b u t . . .
2004-04-14 15:53:39 +00:00
s m o k e r s a r e p. . .
]]>
2004-04-18 17:30:04 +00:00
</screen>
</example>
</chapter>
2004-04-14 15:53:39 +00:00
2004-03-28 15:15:38 +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
2004-04-13 08:46:28 +00:00
-->