Forum


Replies: 8   Views: 3430
Addtemplatevariable table issue
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by DamienB  · 11-04-2013 - 12:12

I have the same problem as profeo with populating a table in a template.

Let's say i have a simple table in my template with the two columns, two rows. The first row is just a header. The second contains the variables $ethnicity$, $total$. The array I pass to $docx->addTemplateVariable is:

[code]
Array
(
[0] => Array
(
[ethnicity] => White
[total] => 440
)

[1] => Array
(
[ethnicity] => African American
[total] => 158
)

[2] => Array
(
[ethnicity] => Hispanic
[total] => 176
)

[3] => Array
(
[ethnicity] => Asian / Pacific Islander
[total] => 14
)

[4] => Array
(
[ethnicity] => American Indian
[total] => 4
)

[5] => Array
(
[ethnicity] => Other
[total] => 117
)

)

[/code]

According to your documentation/ tutorials, I should expect the table in my template to be populated with 6 rows of data. Instead, I only get one row. What do I need to do to troubleshoot this?