|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
i am working on a smarty template with some passed in arrays from
another programmer. is there a way in smarty of walking through the array to find out the index names etc? eg in the .tpl {$array[0].key} or {foreach item=fitem key=fkey from=$titem} {$fkey} thanks! -- _______________________________________________ David "DC" Collier US 1-415-283-7742 dc@pikkle.com skype: callto://d3ntaku http://www.pikkle.com +81 (0)80 6521 9559 http://charajam.com$B!!!Z!z%-%c%i"v%8%c%`!z![(B $B?M5$%-%c%i$H(BJ-POP$B:G?7%R%C%H6J$r<+J,$GAH$_9g$o$;$F(B $BBT<u(BFlash$B$dCe(BFlash$B$r:n$C$A$c$*$&!* (B _______________________________________________ |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Well, one simple way is to use php's array_keys as a modifier:
eg: {assign var=keys value=$record|array_keys} xo boots --- D_C <lister@pikkle.com> wrote: > i am working on a smarty template with some passed in arrays from > another programmer. > > is there a way in smarty of walking through the array to find out the > index names etc? > > eg in the .tpl > > {$array[0].key} > > or > > {foreach item=fitem key=fkey from=$titem} > {$fkey} > > thanks! __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Hello,
Yes there is, kinda like the second example you made: http://smarty.php.net/manual/en/lang...on.foreach.php HTH -----Ursprüngliche Nachricht----- Von: d3ntaku@gmail.com [mailto:d3ntaku@gmail.com] Im Auftrag von D_C Gesendet: Thursday, 06 April 2006 4:34 An: Smarty Betreff: [SMARTY] finding array members i am working on a smarty template with some passed in arrays from another programmer. is there a way in smarty of walking through the array to find out the index names etc? eg in the .tpl {$array[0].key} or {foreach item=fitem key=fkey from=$titem} {$fkey} thanks! -- _______________________________________________ David "DC" Collier US 1-415-283-7742 dc@pikkle.com skype: callto://d3ntaku http://www.pikkle.com +81 (0)80 6521 9559 http://charajam.com ã€â˜…ã‚ャラ♪ジャãƒâ˜…】 人気ã‚ャラã¨J-POP最新ヒット曲を自分ã§çµ„ã¿åˆã‚ã›ã ¦ å¾…å—Flashã‚„ç€Flashを作ã£ã¡ã‚ƒãŠã†ï¼ _______________________________________________ -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
boots wrote:
> Well, one simple way is to use php's array_keys as a modifier: > > eg: > > {assign var=keys value=$record|array_keys} Presumably that should be: {assign var=keys value=$record|@array_keys} ... to have array_keys act on the array as a whole, not on each array element individually. -- Mark Rogers More Solutions Ltd :: 0845 45 89 555 |
|
![]() |
| Outils de la discussion | |
|
|