update quote docs to mention modifiers must be outside quotes

This commit is contained in:
mohrt
2004-12-20 19:52:32 +00:00
parent b7b32860f5
commit 75c1349d7e

View File

@@ -3,10 +3,11 @@
<sect1 id="language.syntax.quotes"> <sect1 id="language.syntax.quotes">
<title>Embedding Vars in Double Quotes</title> <title>Embedding Vars in Double Quotes</title>
<para> <para>
Smarty will recognize assigned variables embedded in double quotes so long Smarty will recognize assigned variables embedded in double quotes so long as
as the variables contain only numbers, letters, underscores and brackets the variables contain only numbers, letters, underscores and brackets [].
[]. With any other characters (period, object reference, etc.) the variable With any other characters (period, object reference, etc.) the variable must
must be surrounded by backticks. be surrounded by backticks. You cannot embed modifiers, they must always be
applied outside of quotes.
</para> </para>
<example> <example>
<title>embedded quotes syntax</title> <title>embedded quotes syntax</title>
@@ -19,6 +20,7 @@ SYNTAX EXAMPLES:
{func var="test $foo[bar] test"} <-- sees $foo[bar] {func var="test $foo[bar] test"} <-- sees $foo[bar]
{func var="test $foo.bar test"} <-- sees $foo (not $foo.bar) {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"} <-- sees $foo.bar
{func var="test `$foo.bar` test"|escape} <-- modifiers outside quotes!
PRACTICAL EXAMPLES: PRACTICAL EXAMPLES:
{include file="subdir/$tpl_name.tpl"} <-- will replace $tpl_name with value {include file="subdir/$tpl_name.tpl"} <-- will replace $tpl_name with value