Always use {$aaa} feel handy
Think that even JS and CSS
Big deal with a {literal} ... {/literal}
Just to filter it out.
But I did not expect that later in the template JS json more and more things
A little JQ plugin even ... Need to foreach my data and add the data to the JSON
Later I think it has not officially launched, first use $smarty->auto_literal development bar
But then ... Why do you think it's a little slower?
I would like to ask you have used smarty friends, we will open this $smarty->auto_literal?
If it will open this, I do not use {} This attachment is actually the same?
If it affects performance, is it worthwhile to replace the code {}?
Reply to discussion (solution)
{literal} ..... Does {/literal} have the same effect as a $smarty->auto_literal?
{literal} ..... {/literal} can be seen from the meaning of its words (literal text) is not resolved in the course of the content, even if there are template components
The $smarty->auto_literal default is true in the manual, which is interpreted as: ignore whitespace around qualifiers
That is, {$aaa} and {$aaa} are interpreted as template variables
And in the Smarty era, this is usually the way to write style sheets.
div {{$name}: {$val};}
Using spaces to prevent misunderstandings
Template parsing is a one-off (when the storage time of a template file changes), so no matter what strategy you use to write the template, it will not affect the speed of running (except for the first time)
I use {# #} to do the delimiter, to avoid that???。
{literal} ..... Does {/literal} have the same effect as a $smarty->auto_literal?
{literal} ..... {/literal} can be seen from the meaning of its words (literal text) is not resolved in the course of the content, even if there are template components
The $smarty->auto_literal default is true in the manual, which is interpreted as: ignore whitespace around qualifiers
That is, {$aaa} and {$aaa} are interpreted as template variables
And in the Smarty era, this is usually the way to write style sheets.
div {{$name}: {$val};}
Using spaces to prevent misunderstandings
Template parsing is a one-off (when the storage time of a template file changes), so no matter what strategy you use to write the template, it will not affect the speed of running (except for the first time)
Oh
This is really not a clear point.
All I know is to solve my problem.
div {{$name}: {$val}; it's a trick to learn, thank you.
I use {# #} to do the delimiter, to avoid the problem.
Thank you for your advice, #的确不错, there will be no conflict in the Web except Css#id.
Thank you two bit, know that will not affect the operational effectiveness of the line