RE: [SMARTY] Dereferencing associative arrays?
| From: | Josh Johnson | Date: | Tue, 15 Oct 2002 02:53:48 +0000 |
| Subject: | RE: [SMARTY] Dereferencing associative arrays? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6136@lists.php.net to get a copy of this message | ||
When you are accessing a template variable inside of a template function
(in this case, the template variable is $user.name and the template
function is assign), you mustn't use quotes around the variable.
It should be:
{assign var="message" value=$user.name}
Hope that solves your problem :)
-- Josh
-----Original Message-----
From: Michal Prinke [mailto:bogien@conecto.pl]
Sent: Monday, October 14, 2002 8:21 PM
To: Smarty
Subject: [SMARTY] Dereferencing associative arrays?
Hello,
When I try to dereference an associative array "user" like this:
{assign var="message" value="$user.name"}
I get such an output of {$message}:
Array.name
...but when I perform:
{assign var="message" value="$user[name]"}
...I get the correct output of {$message}:
John Smith
What I do wrong?
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php