document new optional parameter for capitalize modifier and update example to show behaviour

This commit is contained in:
boots
2004-08-24 06:00:54 +00:00
parent aa4eae4abd
commit e99e825c50

View File

@@ -2,6 +2,34 @@
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.modifier.capitalize"> <sect1 id="language.modifier.capitalize">
<title>capitalize</title> <title>capitalize</title>
<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>Parameter Position</entry>
<entry>Type</entry>
<entry>Required</entry>
<entry>Default</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>1</entry>
<entry>boolean</entry>
<entry>No</entry>
<entry>false</entry>
<entry>This determines whether or not words with
digits will be uppercased</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para> <para>
This is used to capitalize the first letter of all words in a variable. This is used to capitalize the first letter of all words in a variable.
</para> </para>
@@ -12,7 +40,7 @@
<?php <?php
$smarty = new Smarty; $smarty = new Smarty;
$smarty->assign('articleTitle', 'Police begin campaign to rundown jaywalkers.'); $smarty->assign('articleTitle', 'next x-men film, x3, delayed.');
$smarty->display('index.tpl'); $smarty->display('index.tpl');
?> ?>
@@ -25,6 +53,7 @@ $smarty->display('index.tpl');
<![CDATA[ <![CDATA[
{$articleTitle} {$articleTitle}
{$articleTitle|capitalize} {$articleTitle|capitalize}
{$articleTitle|capitalize:true}
]]> ]]>
</programlisting> </programlisting>
<para> <para>
@@ -32,8 +61,9 @@ $smarty->display('index.tpl');
</para> </para>
<screen> <screen>
<![CDATA[ <![CDATA[
Police begin campaign to rundown jaywalkers. next x-men film, x3, delayed.
Police Begin Campaign To Rundown Jaywalkers. Next X-Men Film, x3, Delayed.
Next X-Men Film, X3, Delayed.
]]> ]]>
</screen> </screen>
</example> </example>
@@ -57,4 +87,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->