Smarty 3 associative array with key="null"

18 views
Skip to first unread message

Abalam

unread,
Feb 27, 2009, 9:06:34 AM2/27/09
to Smarty Developers
Hi,

It seems that {$item.null} returns nothing, but {$item["null"]} works.

$item = array("null"=>true)

Regards,
Yann

U.Tews

unread,
Feb 28, 2009, 9:05:12 AM2/28/09
to Smarty Developers
Yann

null, true, false are not unquoted strings. They are interpreted as
the PHP values null, true false.

If you want to use null as array index you must quote it.

{$item.'null'}

Uwe

Abalam

unread,
Feb 28, 2009, 12:40:00 PM2/28/09
to Smarty Developers
OK, just noticing it's different from Smarty 2 for that case.

Regards,
Yann

U.Tews

unread,
Feb 28, 2009, 1:55:19 PM2/28/09
to Smarty Developers
I just changed some unqouted string handling. {$item.null} should work
now.
Uwe
Reply all
Reply to author
Forward
0 new messages