PHPOffice/PHPWord — pull request #28 by jeroenmoors (2013-09-12 19:53:43+00:00)
Title: Add "cloneRow" function to clone a table row in a template document.

Hi,

One missing feature of the templating part of the PHPWord is the ability to create a table with a dynamic number of rows.

The function I wrote (cloneRow) allows you to clone the required number of times a row of a table in your template file.

The function takes two parameters, any template variable found on the specific row to identify the row to clone and the number of required rows.

All variables found on the table row will be suffixed with a # and a row number, so setValue can be used to set the variables values.

Some time ago a wrote a blog post how this works, maybe that clarifies all: http://jeroen.is/phpword-templates-with-repeating-rows/

Jeroen