Home > Archive > PHP Smarty Templates > March 2008 > Re: [SMARTY] Array keys, values
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [SMARTY] Array keys, values
|
|
| Christoph Boget 2007-10-15, 7:16 pm |
| On 10/15/07, Max Schwanekamp <lists@neptunewebworks.com> wrote:
>
> Christoph Boget wrote:
>
> {$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.
And if I don't know the key value off hand because the array was generated
dynamically?
As an aside, 2 features that would be really nice when working with arrays
in a smarty template:
* get the total count of the elements w/o having to iterate through the
array
* be able to access the first or last element even if the keys aren't
numeric
thnx,
Christoph
| |
|
|
|
|
|
|
|
|
|
|
|