mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
update quote docs to mention modifiers must be outside quotes
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user