cleaned the WS in this file and added more CDATA

# if I ever see a bad WS in this file, I'll kill someone :)
This commit is contained in:
didou
2004-03-31 11:20:13 +00:00
parent 579759d1ae
commit 4b46f6bc51

View File

@@ -338,7 +338,7 @@ Dealers Will Hear Car Talk at Noon.
]]>
</screen>
</example>
</sect1> <!-- didou -->
</sect1>
<sect1 id="language.modifier.date.format">
<title>date_format</title>
<informaltable frame="all">
@@ -386,31 +386,43 @@ Dealers Will Hear Car Talk at Noon.
</para>
<example>
<title>date_format</title>
<programlisting role="php">
<![CDATA[
<?php
$smarty = new Smarty;
$smarty->assign('yesterday', strtotime('-1 day'));
$smarty->display('index.tpl');
?>
]]>
</programlisting>
<para>
Where index.tpl is:
</para>
<programlisting>
index.php:
$smarty = new Smarty;
$smarty-&gt;assign('yesterday', strtotime('-1 day'));
$smarty-&gt;display('index.tpl');
index.tpl:
{$smarty.now|date_format}
{$smarty.now|date_format:"%A, %B %e, %Y"}
{$smarty.now|date_format:"%H:%M:%S"}
{$yesterday|date_format}
{$yesterday|date_format:"%A, %B %e, %Y"}
{$yesterday|date_format:"%H:%M:%S"}
OUTPUT:
Feb 6, 2001
Tuesday, February 6, 2001
14:33:00
Feb 5, 2001
Monday, February 5, 2001
14:33:00</programlisting>
<![CDATA[
{$smarty.now|date_format}
{$smarty.now|date_format:"%A, %B %e, %Y"}
{$smarty.now|date_format:"%H:%M:%S"}
{$yesterday|date_format}
{$yesterday|date_format:"%A, %B %e, %Y"}
{$yesterday|date_format:"%H:%M:%S"}
]]>
</programlisting>
<para>
This will output:
</para>
<screen>
<![CDATA[
Feb 6, 2001
Tuesday, February 6, 2001
14:33:00
Feb 5, 2001
Monday, February 5, 2001
14:33:00
]]>
</screen>
</example>
<para>
date_format conversion specifiers:
@@ -537,8 +549,8 @@ Dealers Will Hear Car Talk at Noon.
</para>
</note>
</para>
</sect1>
<sect1 id="language.modifier.default">
<title>default</title>
<informaltable frame="all">
@@ -576,22 +588,35 @@ Dealers Will Hear Car Talk at Noon.
</para>
<example>
<title>default</title>
<programlisting role="php">
<![CDATA[
<?php
$smarty = new Smarty;
$smarty->assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.');
$smarty->display('index.tpl');
?>
]]>
</programlisting>
<para>
Where index.tpl is:
</para>
<programlisting>
index.php:
$smarty = new Smarty;
$smarty-&gt;assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.');
$smarty-&gt;display('index.tpl');
index.tpl:
{$articleTitle|default:"no title"}
{$myTitle|default:"no title"}
OUTPUT:
Dealers Will Hear Car Talk at Noon.
no title</programlisting>
<![CDATA[
{$articleTitle|default:"no title"}
{$myTitle|default:"no title"}
]]>
</programlisting>
<para>
This will output:
</para>
<screen>
<![CDATA[
Dealers Will Hear Car Talk at Noon.
no title
]]>
</screen>
</example>
</sect1>
<sect1 id="language.modifier.escape">
@@ -634,32 +659,47 @@ Dealers Will Hear Car Talk at Noon.
</para>
<example>
<title>escape</title>
<programlisting role="php">
<![CDATA[
<?php
$smarty = new Smarty;
$smarty->assign('articleTitle', "'Stiff Opposition Expected to Casketless Funeral Plan'");
$smarty->display('index.tpl');
?>
]]>
</programlisting>
<para>
Where index.tpl is:
</para>
<programlisting>
index.php:
$smarty = new Smarty;
$smarty-&gt;assign('articleTitle', "'Stiff Opposition Expected to Casketless Funeral Plan'");
$smarty-&gt;display('index.tpl');
index.tpl:
{$articleTitle}
{$articleTitle|escape}
{$articleTitle|escape:"html"} {* escapes &amp; &quot; &#039; &lt; &gt; *}
{$articleTitle|escape:"htmlall"} {* escapes ALL html entities *}
{$articleTitle|escape:"url"}
{$articleTitle|escape:"quotes"}
&lt;a href="mailto:{$EmailAddress|escape:"hex"}"&gt;{$EmailAddress|escape:"hexentity"}&lt;/a&gt;
OUTPUT:
'Stiff Opposition Expected to Casketless Funeral Plan'
&#039;Stiff Opposition Expected to Casketless Funeral Plan&#039;
&#039;Stiff Opposition Expected to Casketless Funeral Plan&#039;
&#039;Stiff Opposition Expected to Casketless Funeral Plan&#039;
%27Stiff+Opposition+Expected+to+Casketless+Funeral+Plan%27
\'Stiff Opposition Expected to Casketless Funeral Plan\'
&lt;a href=&quot;mailto:%62%6f%62%40%6d%65%2e%6e%65%74&quot;&gt;&#x62;&#x6f;&#x62;&#x40;&#x6d;&#x65;&#x2e;&#x6e;&#x65;&#x74;&lt;/a&gt;</programlisting>
<![CDATA[
{$articleTitle}
{$articleTitle|escape}
{$articleTitle|escape:"html"} {* escapes &amp; &quot; &#039; &lt; &gt; *}
{$articleTitle|escape:"htmlall"} {* escapes ALL html entities *}
{$articleTitle|escape:"url"}
{$articleTitle|escape:"quotes"}
<a
href="mailto:{$EmailAddress|escape:"hex"}">{$EmailAddress|escape:"hexentity"}</a>
]]>
</programlisting>
<para>
This will output:
</para>
<screen>
<![CDATA[
'Stiff Opposition Expected to Casketless Funeral Plan'
&#039;Stiff Opposition Expected to Casketless Funeral Plan&#039;
&#039;Stiff Opposition Expected to Casketless Funeral Plan&#039;
&#039;Stiff Opposition Expected to Casketless Funeral Plan&#039;
%27Stiff+Opposition+Expected+to+Casketless+Funeral+Plan%27
\'Stiff Opposition Expected to Casketless Funeral Plan\'
<a
href=&quot;mailto:%62%6f%62%40%6d%65%2e%6e%65%74&quot;&gt;&#x62;&#x6f;&#x62;&#x40;&#x6d;&#x65;&#x2e;&#x6e;&#x65;&#x74;</a>
]]>
</screen>
</example>
</sect1>
<sect1 id="language.modifier.indent">
@@ -707,40 +747,53 @@ Dealers Will Hear Car Talk at Noon.
</para>
<example>
<title>indent</title>
<programlisting role="php">
<![CDATA[
<?php
$smarty = new Smarty;
$smarty-&gt;assign('articleTitle', 'NJ judge to rule on nude beach.');
$smarty-&gt;display('index.tpl');
?>
]]>
</programlisting>
<para>
Where index.tpl is:
</para>
<programlisting>
index.php:
<![CDATA[
{$articleTitle}
$smarty = new Smarty;
$smarty-&gt;assign('articleTitle', 'NJ judge to rule on nude beach.');
$smarty-&gt;display('index.tpl');
{$articleTitle|indent}
index.tpl:
{$articleTitle|indent:10}
{$articleTitle}
{$articleTitle|indent:1:"\t"}
]]>
</programlisting>
<para>
this will output:
</para>
<screen>
<![CDATA[
NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.
{$articleTitle|indent}
NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.
{$articleTitle|indent:10}
NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.
{$articleTitle|indent:1:"\t"}
OUTPUT:
NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.
NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.
NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.
NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.</programlisting>
NJ judge to rule on nude beach.
Sun or rain expected today, dark tonight.
Statistics show that teen pregnancy drops off significantly after 25.
]]>
</screen>
</example>
</sect1>
<sect1 id="language.modifier.lower">
@@ -750,22 +803,35 @@ Dealers Will Hear Car Talk at Noon.
</para>
<example>
<title>lower</title>
<programlisting role="php">
<![CDATA[
<?php
$smarty = new Smarty;
$smarty->assign('articleTitle', 'Two Convicts Evade Noose, Jury Hung.');
$smarty->display('index.tpl');
?>
]]>
</programlisting>
<para>
Where index.tpl is:
</para>
<programlisting>
index.php:
$smarty = new Smarty;
$smarty-&gt;assign('articleTitle', 'Two Convicts Evade Noose, Jury Hung.');
$smarty-&gt;display('index.tpl');
index.tpl:
{$articleTitle}
{$articleTitle|lower}
OUTPUT:
Two Convicts Evade Noose, Jury Hung.
two convicts evade noose, jury hung.</programlisting>
<![CDATA[
{$articleTitle}
{$articleTitle|lower}
]]>
</programlisting>
<para>
This will output:
</para>
<screen>
<![CDATA[
Two Convicts Evade Noose, Jury Hung.
two convicts evade noose, jury hung.
]]>
</screen>
</example>
</sect1>
<sect1 id="language.modifier.nl2br">
@@ -776,20 +842,33 @@ Dealers Will Hear Car Talk at Noon.
</para>
<example>
<title>nl2br</title>
<programlisting role="php">
<![CDATA[
<?php
$smarty = new Smarty;
$smarty->assign('articleTitle', "Sun or rain expected\ntoday, dark tonight");
$smarty->display('index.tpl');
?>
]]>
</programlisting>
<para>
Where index.tpl is:
</para>
<programlisting>
index.php:
$smarty = new Smarty;
$smarty-&gt;assign('articleTitle', "Sun or rain expected\ntoday, dark tonight");
$smarty-&gt;display('index.tpl');
index.tpl:
{$articleTitle|nl2br}
OUTPUT:
Sun or rain expected&lt;br /&gt;today, dark tonight</programlisting>
<![CDATA[
{$articleTitle|nl2br}
]]>
</programlisting>
<para>
This should output:
</para>
<screen>
<![CDATA[
Sun or rain expected<br />today, dark tonight
]]>
</screen>
</example>
</sect1>
<sect1 id="language.modifier.regex.replace">
@@ -852,7 +931,8 @@ Dealers Will Hear Car Talk at Noon.
Infertility unlikely to
be passed on, experts say.
Infertility unlikely to be passed on, experts say.</programlisting>
Infertility unlikely to be passed on, experts say.
</programlisting>
</example>
</sect1>
<sect1 id="language.modifier.replace">
@@ -913,7 +993,8 @@ Dealers Will Hear Car Talk at Noon.
Child's Stool Great for Use in Garden.
Child's Stool Great for Use in Vineyard.
Child's Stool Great for Use in Garden.</programlisting>
Child's Stool Great for Use in Garden.
</programlisting>
</example>
</sect1>
<sect1 id="language.modifier.spacify">
@@ -969,7 +1050,8 @@ Dealers Will Hear Car Talk at Noon.
Something Went Wrong in Jet Crash, Experts Say.
S o m e t h i n g W e n t W r o n g i n J e t C r a s h , E x p e r t s S a y .
S^^o^^m^^e^^t^^h^^i^^n^^g^^ ^^W^^e^^n^^t^^ ^^W^^r^^o^^n^^g^^ ^^i^^n^^ ^^J^^e^^t^^ ^^C^^r^^a^^s^^h^^,^^ ^^E^^x^^p^^e^^r^^t^^s^^ ^^S^^a^^y^^.</programlisting>
S^^o^^m^^e^^t^^h^^i^^n^^g^^ ^^W^^e^^n^^t^^ ^^W^^r^^o^^n^^g^^ ^^i^^n^^ ^^J^^e^^t^^ ^^C^^r^^a^^s^^h^^,^^ ^^E^^x^^p^^e^^r^^t^^s^^ ^^S^^a^^y^^.
</programlisting>
</example>
</sect1>
<sect1 id="language.modifier.string.format">
@@ -1024,7 +1106,8 @@ Dealers Will Hear Car Talk at Noon.
23.5787446
23.58
24</programlisting>
24
</programlisting>
</example>
</sect1>
<sect1 id="language.modifier.strip">
@@ -1062,7 +1145,8 @@ Grandmother of
eight makes hole in one.
Grandmother of eight makes hole in one.
Grandmother&nbsp;of&nbsp;eight&nbsp;makes&nbsp;hole&nbsp;in&nbsp;one.
]]></programlisting>
]]>
</programlisting>
</example>
</sect1>
<sect1 id="language.modifier.strip.tags">
@@ -1087,7 +1171,8 @@ Grandmother&nbsp;of&nbsp;eight&nbsp;makes&nbsp;hole&nbsp;in&nbsp;one.
OUTPUT:
Blind Woman Gets &lt;font face="helvetica"&gt;New Kidney&lt;/font&gt; from Dad she Hasn't Seen in &lt;b&gt;years&lt;/b&gt;.
Blind Woman Gets New Kidney from Dad she Hasn't Seen in years.</programlisting>
Blind Woman Gets New Kidney from Dad she Hasn't Seen in years.
</programlisting>
</example>
</sect1>
<sect1 id="language.modifier.truncate">
@@ -1171,7 +1256,8 @@ Grandmother&nbsp;of&nbsp;eight&nbsp;makes&nbsp;hole&nbsp;in&nbsp;one.
Two Sisters Reunite after
Two Sisters Reunite after---
Two Sisters Reunite after Eigh
Two Sisters Reunite after E...</programlisting>
Two Sisters Reunite after E...
</programlisting>
</example>
</sect1>
<sect1 id="language.modifier.upper">
@@ -1196,7 +1282,8 @@ Grandmother&nbsp;of&nbsp;eight&nbsp;makes&nbsp;hole&nbsp;in&nbsp;one.
OUTPUT:
If Strike isn't Settled Quickly it may Last a While.
IF STRIKE ISN'T SETTLED QUICKLY IT MAY LAST A WHILE.</programlisting>
IF STRIKE ISN'T SETTLED QUICKLY IT MAY LAST A WHILE.
</programlisting>
</example>
</sect1>
<sect1 id="language.modifier.wordwrap">
@@ -1291,11 +1378,13 @@ Grandmother&nbsp;of&nbsp;eight&nbsp;makes&nbsp;hole&nbsp;in&nbsp;one.
Blind woman gets new kidney fr
om dad she hasn't seen in year
s.</programlisting>
s.
</programlisting>
</example>
</sect1>
</chapter>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml