cvs: smarty /docs/en/designers language-basic-syntax.xml language-builtin-functions.xml /docs/en/designers/language-basic-syntax language-syntax-attributes.xml language-syntax-comments.xml language-syntax-quotes.xml /docs/en/designers/language-modifiers language-modifier-escape.xml
[email protected] ("Peter 'Mash' Morgan") Mon, 09 Oct 2006 22:50:41 -0000
| Newsgroups | php.smarty.cvs |
|---|---|
| Message-ID | <cvspete_morgan1160434241@cvsserver> |
pete_morgan Mon Oct 9 22:50:41 2006 UTC
Modified files:
/smarty/docs/en/designers language-basic-syntax.xml
language-builtin-functions.xml
/smarty/docs/en/designers/language-basic-syntax
language-syntax-attributes.xml
language-syntax-comments.xml
language-syntax-quotes.xml
/smarty/docs/en/designers/language-modifiers
language-modifier-escape.xml
Log:
Minor formatting and error correction
pete_morgan-20061009225041.txt
(text/plain, 12.3 KB)
http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-basic-syntax.xml?r1=1.6&r2=1.7&diff_format=u
Index: smarty/docs/en/designers/language-basic-syntax.xml
diff -u smarty/docs/en/designers/language-basic-syntax.xml:1.6 smarty/docs/en/designers/language-basic-syntax.xml:1.7
--- smarty/docs/en/designers/language-basic-syntax.xml:1.6 Sun May 8 19:47:00 2005
+++ smarty/docs/en/designers/language-basic-syntax.xml Mon Oct 9 22:50:41 2006
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
<chapter id="language.basic.syntax">
<title>Basic Syntax</title>
<para>
All Smarty template tags are enclosed within delimiters. By
- default, these delimiters are <literal>{</literal> and
+ default these are <literal>{</literal> and
<literal>}</literal>, but they can be <link linkend="variable.left.delimiter">changed</link>.
</para>
<para>
- For these examples, we will assume that you are using the default
+ For examples, we will assume that you are using the default
delimiters. In Smarty, all content outside of delimiters is displayed as
static content, or unchanged. When Smarty encounters template tags, it
attempts to interpret them, and displays the appropriate output in their
@@ -22,7 +22,7 @@
&designers.language-basic-syntax.language-syntax-quotes;
&designers.language-basic-syntax.language-math;
&designers.language-basic-syntax.language-escaping;
-
+
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-builtin-functions.xml?r1=1.7&r2=1.8&diff_format=u
Index: smarty/docs/en/designers/language-builtin-functions.xml
diff -u smarty/docs/en/designers/language-builtin-functions.xml:1.7 smarty/docs/en/designers/language-builtin-functions.xml:1.8
--- smarty/docs/en/designers/language-builtin-functions.xml:1.7 Tue Sep 26 19:28:45 2006
+++ smarty/docs/en/designers/language-builtin-functions.xml Mon Oct 9 22:50:41 2006
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.7 $ -->
+<!-- $Revision: 1.8 $ -->
<chapter id="language.builtin.functions">
<title>Built-in Functions</title>
<para>
@@ -7,12 +7,12 @@
are the integral part of the smarty template engine. You cannot create your own
<link linkend="language.custom.functions">custom functions</link>
with the same name; and you should not need to
- modify the built-in functions.
- </para>
+ modify the built-in functions.</para>
+
<para>
- A few on these functions have an <parameter>assign</parameter>
- attribute which collects the result the function to a named
- variable within a template instead of being output;
+ A few of these functions have an <parameter>assign</parameter>
+ attribute which collects the result the function to a named template
+ variable instead of being output;
much like the <link linkend="language.function.assign">
<varname>{assign}</varname></link> function.
</para>
http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-basic-syntax/language-syntax-attributes.xml?r1=1.6&r2=1.7&diff_format=u
Index: smarty/docs/en/designers/language-basic-syntax/language-syntax-attributes.xml
diff -u smarty/docs/en/designers/language-basic-syntax/language-syntax-attributes.xml:1.6 smarty/docs/en/designers/language-basic-syntax/language-syntax-attributes.xml:1.7
--- smarty/docs/en/designers/language-basic-syntax/language-syntax-attributes.xml:1.6 Thu Mar 16 02:09:40 2006
+++ smarty/docs/en/designers/language-basic-syntax/language-syntax-attributes.xml Mon Oct 9 22:50:41 2006
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
<sect1 id="language.syntax.attributes">
<title>Attributes</title>
<para>
@@ -11,7 +11,7 @@
should not be in quotes.
</para>
<para>
- Some attributes require boolean values (true or false). These
+ Some attributes require boolean values (&true; or &false;). These
can be specified
as either unquoted <literal>true</literal>,
<literal>on</literal>, and <literal>yes</literal>, or
http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-basic-syntax/language-syntax-comments.xml?r1=1.13&r2=1.14&diff_format=u
Index: smarty/docs/en/designers/language-basic-syntax/language-syntax-comments.xml
diff -u smarty/docs/en/designers/language-basic-syntax/language-syntax-comments.xml:1.13 smarty/docs/en/designers/language-basic-syntax/language-syntax-comments.xml:1.14
--- smarty/docs/en/designers/language-basic-syntax/language-syntax-comments.xml:1.13 Wed Sep 27 08:47:36 2006
+++ smarty/docs/en/designers/language-basic-syntax/language-syntax-comments.xml Mon Oct 9 22:50:41 2006
@@ -1,15 +1,24 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.13 $ -->
+<!-- $Revision: 1.14 $ -->
<sect1 id="language.syntax.comments">
<title>Comments</title>
<para>
Template comments are surrounded by asterisks, and that is surrounded
by the
<link linkend="variable.left.delimiter">delimiter</link>
- tags like so: <literal>{* this is a comment *}</literal>
+ tags like so:
+ </para>
+ <informalexample>
+ <programlisting>
+<![CDATA[
+{* this is a comment *}
+]]>
+ </programlisting>
+ </informalexample>
+ <para>
Smarty comments are NOT displayed in the final output of the template,
- unlike <literal><!-- HTML comments --></literal>
- these are useful for making internal notes in the templates which no one will see ;-)
+ unlike <literal><!-- HTML comments --></literal>.
+ These are useful for making internal notes in the templates which no one will see ;-)
</para>
<example>
<title>Comments within a template</title>
@@ -53,6 +62,18 @@
</select>
*}
+<!-- Show header from affiliate is disabled -->
+{* $affiliate|upper *}
+
+{* you cannot nest comments *}
+{*
+<select name="company">
+ {* <option value="0">-- none -- </option> *}
+ {html_options options=$vals selected=$selected_id}
+</select>
+*}
+
+
{* cvs tag for a template, below the 36 SHOULD be an american currency
. however its converted in cvs.. *}
{* $Id: Exp $ *}
http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-basic-syntax/language-syntax-quotes.xml?r1=1.9&r2=1.10&diff_format=u
Index: smarty/docs/en/designers/language-basic-syntax/language-syntax-quotes.xml
diff -u smarty/docs/en/designers/language-basic-syntax/language-syntax-quotes.xml:1.9 smarty/docs/en/designers/language-basic-syntax/language-syntax-quotes.xml:1.10
--- smarty/docs/en/designers/language-basic-syntax/language-syntax-quotes.xml:1.9 Tue Sep 26 02:42:08 2006
+++ smarty/docs/en/designers/language-basic-syntax/language-syntax-quotes.xml Mon Oct 9 22:50:41 2006
@@ -1,25 +1,36 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
+<!-- $Revision: 1.10 $ -->
<sect1 id="language.syntax.quotes">
<title>Embedding Vars in Double Quotes</title>
+
+ <itemizedlist>
+ <listitem>
<para>
Smarty will recognize <link
linkend="api.assign">assigned</link>
<link linkend="language.syntax.variables">variables</link>
- embedded in double quotes so long as the variable name contains only numbers,
- letters, underscores and brackets[]
- (see <ulink url="&url.php-manual;language.variables">naming</ulink>).
- With any other characters (period,
- object reference, etc.) the variable must be surrounded by
- `backticks`. You cannot embed
+ embedded in "double quotes" so long as the variable name contains only numbers,
+ letters, under_scores and brackets[].
+ See <ulink url="&url.php-manual;language.variables">naming</ulink>
+ for more detail.
+ </para></listitem>
+
+ <listitem><para>
+ With any other characters, for example a .period or
+ <literal>$object>reference</literal>, then the variable must be
+ surrounded by <literal>`backticks`</literal>.
+ </para></listitem>
+
+ <listitem><para>You cannot embed
<link linkend="language.modifiers">modifiers</link>, they must always
be applied outside of quotes.
- </para>
+ </para></listitem>
+ </itemizedlist>
+
<example>
- <title>embedded quotes syntax</title>
+ <title>Syntax examples</title>
<programlisting>
<![CDATA[
-SYNTAX EXAMPLES:
{func var="test $foo test"} <-- sees $foo
{func var="test $foo_bar test"} <-- sees $foo_bar
{func var="test $foo[0] test"} <-- sees $foo[0]
@@ -27,13 +38,32 @@
{func var="test $foo.bar test"} <-- sees $foo (not $foo.bar)
{func var="test `$foo.bar` test"} <-- sees $foo.bar
{func var="test `$foo.bar` test"|escape} <-- modifiers outside quotes!
+]]>
+ </programlisting>
+</example>
-PRACTICAL EXAMPLES:
-{include file="subdir/$tpl_name.tpl"} <-- will replace $tpl_name with value
-{cycle values="one,two,`$smarty.config.myval`"} <-- must have backticks
+ <example>
+ <title>Practical examples</title>
+ <programlisting>
+<![CDATA[
+{* will replace $tpl_name with value *}
+{include file="subdir/$tpl_name.tpl"}
+
+{* doesn't replace $tpl_name *}
+{include file='subdir/$tpl_name.tpl'} <--
+
+{* must have backticks as it contains a . *}
+{cycle values="one,two,`$smarty.config.myval`"}
+
+{* same as $module['contact'].'.tpl' in a php script
+{include file="`$module.contact`.tpl"}
+
+{* same as $module[$view].'.tpl' in a php script
+{include file="$module.$view.tpl"}
]]>
</programlisting>
</example>
+
<para>
See also <link linkend="language.modifier.escape"><varname>escape</varname></link>.
</para>
http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml?r1=1.16&r2=1.17&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.16 smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml:1.17
--- smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml:1.16 Tue Sep 26 19:28:45 2006
+++ smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml Mon Oct 9 22:50:41 2006
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.16 $ -->
+<!-- $Revision: 1.17 $ -->
<sect1 id="language.modifier.escape">
<title>escape</title>
<para>
- This is used to encode/escape a variable to <literal>html</literal>,
+ <varname>escape</varname> is used to encode or escape a variable to for example <literal>html</literal>,
<literal>url</literal>, <literal>single quotes</literal>,
<literal>hex</literal>, <literal>hexentity</literal>,
<literal>javascript</literal> and <literal>mail</literal>.
- By default its <literal>html</literal> escaped.
+ By default its <literal>html</literal>.
</para>
<informaltable frame="all">
@@ -73,37 +73,36 @@
]]>
</programlisting>
<para>
- Where template is:
+ These are example <literal>escape</literal> template lines followed by the output
</para>
<programlisting>
<![CDATA[
{$articleTitle}
+'Stiff Opposition Expected to Casketless Funeral Plan'
+
{$articleTitle|escape}
+'Stiff Opposition Expected to Casketless Funeral Plan'
+
{$articleTitle|escape:'html'} {* escapes & " ' < > *}
+'Stiff Opposition Expected to Casketless Funeral Plan'
+
{$articleTitle|escape:'htmlall'} {* escapes ALL html entities *}
-{$articleTitle|escape:'url'}
+'Stiff Opposition Expected to Casketless Funeral Plan'
+
+<a href="?title={$articleTitle|escape:'url'}">click here</a>
+<a href="?title=%27Stiff+Opposition+Expected+to+Casketless+Funeral+Plan%27">click here</a>
+
{$articleTitle|escape:'quotes'}
+\'Stiff Opposition Expected to Casketless Funeral Plan\'
+
<a href="mailto:{$EmailAddress|escape:"hex"}">{$EmailAddress|escape:"hexentity"}</a>
{$EmailAddress|escape:'mail'} {* this converts to email to text *}
-{'[email protected]'|escape:'mail'}
-]]>
- </programlisting>
- <para>
- Will output:
- </para>
- <screen>
-<![CDATA[
-'Stiff Opposition Expected to Casketless Funeral Plan'
-'Stiff Opposition Expected to Casketless Funeral Plan'
-'Stiff Opposition Expected to Casketless Funeral Plan'
-'Stiff Opposition Expected to Casketless Funeral Plan'
-%27Stiff+Opposition+Expected+to+Casketless+Funeral+Plan%27
-\'Stiff Opposition Expected to Casketless Funeral Plan\'
<a href="mailto:%62%6f%..snip..%65%74">bob..snip..et</a>
+
+{'[email protected]'|escape:'mail'}
smarty [AT] example [DOT] com
-mail [AT] example [DOT] com
]]>
- </screen>
+ </programlisting>
</example>
<example>