accessing associative arrays in smarty templates
Posted: Mon Sep 25, 2006 1:16 pm
I've found a lot of articles addressing this question, but none with a good concrete answer.
I have an associative array that I'm building from a sql query (yes I'm filling the entire array before sending it to the template, although this shouldn't matter anyway because there's only one row)...and all I want to do is display the value based on the key on the template.
I've tried:
and
and not had success with either. I could create a foreach loop and loop over this one row and use the dot syntax, but that seems like waaaay too much overkill to just grab the info out of a single array!
I have an associative array that I'm building from a sql query (yes I'm filling the entire array before sending it to the template, although this shouldn't matter anyway because there's only one row)...and all I want to do is display the value based on the key on the template.
I've tried:
Code: Select all
Project Type: {$folio[projecttype]}Code: Select all
Project Type: {$folio.projecttype}