The Arcive of vBulletin Modifications Site. |
|
quick template question Details »»
|
|||||||||||||||||||||||||
let's say i have a template called
my_template and inside I just want to do this: loop through the elements of an array, and print them out? so, if an array had 'jerry', 'paul', 'marsha' it would print Code:
jerrypaul marsha i know VB obviously has to do this looping in the templates.... thank you. ..jordan willms Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
Give the template contents like $myarray (just a single variable). Then before the template is eval'ed, make sure $myarray contains (substitute \n for <br> if appropriate):
PHP Code:
|
|
#3
|
|||
|
|||
|
maybe i should have been specific, what i want to figure out is how VB does stuff like this :
eg. takes an array of $names[0] = 'bob'; $names[1] = 'sam'; with the following template Code:
<tr> <td> $names </td> </td> Code:
<tr> <td> bob </td> </td> <tr> <td> sam </td> </td> maybe i am not understanding how VB does it. are array's even involved? please help me. thanks in advance. jordan |
![]() |
|
|