cvs: smarty /docs/en/designers/language-modifiers language-modifier-default.xml language-modifier-escape.xml
[email protected] ("Peter 'Mash' Morgan") Mon, 27 Mar 2006 23:58:23 -0000
| Newsgroups | php.smarty.cvs |
|---|---|
| Message-ID | <cvspete_morgan1143503903@cvsserver> |
pete_morgan Mon Mar 27 23:58:23 2006 UTC
Modified files:
/smarty/docs/en/designers/language-modifiers
language-modifier-default.xml
language-modifier-escape.xml
Log:
tweek
http://cvs.php.net/viewcvs.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-default.xml?r1=1.6&r2=1.7&diff_format=u
Index: smarty/docs/en/designers/language-modifiers/language-modifier-default.xml
diff -u smarty/docs/en/designers/language-modifiers/language-modifier-default.xml:1.6 smarty/docs/en/designers/language-modifiers/language-modifier-default.xml:1.7
--- smarty/docs/en/designers/language-modifiers/language-modifier-default.xml:1.6 Tue Mar 7 19:20:27 2006
+++ smarty/docs/en/designers/language-modifiers/language-modifier-default.xml Mon Mar 27 23:58:23 2006
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
<sect1 id="language.modifier.default">
<title>default</title>
<para>
@@ -7,6 +7,14 @@
is empty or unset, the given default value is printed instead.
Default takes one argument.
</para>
+ <para>
+ <note>
+ <para>
+ With error_reporting(E_ALL), undeclared variables will always throw an error within the template. This function
+ is useful for replacing null or zero length strings.
+ </para>
+ </note>
+ </para>
<informaltable frame="all">
<tgroup cols="5">
http://cvs.php.net/viewcvs.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml?r1=1.10&r2=1.11&diff_format=u
Index: smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml
diff -u smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml:1.10 smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml:1.11
--- smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml:1.10 Fri Mar 17 00:12:38 2006
+++ smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml Mon Mar 27 23:58:23 2006
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.10 $ -->
+<!-- $Revision: 1.11 $ -->
<sect1 id="language.modifier.escape">
<title>escape</title>
<para>
- This is used to html escape, url escape, escape single quotes on a
- variable not already escaped, hex escape, hexentity or javascript escape.
- By default, the variable is html
+ This is used to encode/escape and a variable to html url single quotes, hex escape, hexentity, javascript and mail escape.
+ By default its html
escaped.
</para>
@@ -69,12 +68,12 @@
<![CDATA[
{$articleTitle}
{$articleTitle|escape}
-{$articleTitle|escape:"html"} {* escapes & " ' < > *}
-{$articleTitle|escape:"htmlall"} {* escapes ALL html entities *}
-{$articleTitle|escape:"url"}
-{$articleTitle|escape:"quotes"}
+{$articleTitle|escape:'html'} {* escapes & " ' < > *}
+{$articleTitle|escape:'htmlall'} {* escapes ALL html entities *}
+{$articleTitle|escape:'url'}
+{$articleTitle|escape:'quotes'}
<a href="mailto:{$EmailAddress|escape:"hex"}">{$EmailAddress|escape:"hexentity"}</a>
-{$EmailAddress|escape:'mail'}
+{$EmailAddress|escape:'mail'} {* this converts to email to text *}
]]>
</programlisting>
<para>
@@ -92,19 +91,28 @@
smarty [AT] example [DOT] com
]]>
</screen>
- <para>Remember that native PHP functions can be used as modifiers so this will work</para>
+ <para>Note that native PHP functions can be used as modifiers so this will work</para>
<screen>
<![CDATA[
{* rewind get var registers the current location *}
<a href="{$SCRIPT_NAME}?page=foo&rewind={$smarty.server.REQUEST_URI|urlencode}">click here</a>
]]>
- </screen>
+ </screen>
+ <para>And this is very useful for emails but see also
+ <link linkend="language.function.mailto">{mailto}</link></para>
+ <screen>
+ <![CDATA[
+ {* email address mangled *}
+ <a href="mailto:{$EmailAddress|escape:'hex'}">{$EmailAddress:escape'mail'}</a>
+ ]]>
+ </screen>
</example>
<para>
- See also <link linkend="language.escaping">Escaping Smarty Parsing</link>
+ See also <link linkend="language.escaping">Escaping Smarty Parsing</link>,
+ <link linkend="language.function.mailto">{mailto}</link>
and <link linkend="tips.obfuscating.email">Obfuscating E-mail Addresses</link>.
</para>
</sect1>