rë: CVS commit fixes couple things
| From: | Gerard | Date: | Thu, 27 Feb 2003 19:36:31 +0000 |
| Subject: | rë: CVS commit fixes couple things | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-859@lists.php.net to get a copy of this message | ||
Is it possible to access variables like:
{$smarty.cookies.$cookies.username}
where $cookies is another assoc array (with key 'username')?
Gerard
>>>>>>>>>>>>>>>>>
I committed to CVS some changes. First off, any smarty var can be
dynamic:
$smarty.get.$foo
$smarty.post.$foo
$smarty.section.$foo.$bar <-- even section names!
$smarty.const.$foo
$smarty.config.$foo
etc.....
Also for embedding variables in quotes, there has been an ongoing
problem with variable ambiguity:
{include file="$smarty.section.foo.bar.tpl"}
".tpl" is NOT part of the var, but it gets treated that way.
At first I tried using only the first three segments of the smarty var,
but this won't work in all cases. So to solve the problem, you can
enclose embedded variables with back ticks (`).
Example:
{include file="$
smarty.section.foo.bar.tpl"}
It only respects back ticks around an embedded var, so other back ticks
in the text are not a problem. It works pretty well, thoughts?
Monte