RE: [SMARTY] Array keys, values
"Max Schwanekamp" <[email protected]> Mon, 15 Oct 2007 13:41:47 -0700
| Newsgroups | gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <01be01c80f6b$d02a0070$707e0150$@com> |
Christoph Boget wrote:
>If I have an array that looks like this:
>Array ([Salary] => Array ( [0-50K] => Array ( [filterType] => range ) ) )
>
>How can I access the key values? Individually, that is. What about the
>child array key/values? Individually, that is.
{$myArray.Salary.0-50K.filterType} should work, but the key 0-50K might be
problematic due to the leading numeric character (I haven't tried it). If
it doesn't work, try adding a leading alpha char to those key names.
--
Max Schwanekamp
NeptuneWebworks.com
541-517-9064
How can I access the key values? Individually, that is. What about the
child array key/values? Individually, that is. In the template, I've
tried:
{$myArray[0]}
{$myArray[0].filterType}
{$myArray[0][0]}
Nothing seems to work. I know how to iterate through the entire array and
display the contents that way, but I don't know how to get the key/value of
just one particular element (and/or any child arrays of that element).
Any help would be greatly appreciated!
thnx,
Christoph
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php