I need to use the templates as It planned that the user will create a template and specify which fields he wants in the table.
Example table (template docx-file):
____________________________________________
|_____________$header$___________________|
|___$val1$___|___$val2$___|___ $val3$___|
$docx = new CreateDocxFromTemplate('../../files/TemplateSimpleTable.docx');
$data = array(
array(
'val1' => '1',
'val2' => '2',
'val3' => '3',
),
array(
'val1' => '4',
'val2' => '5',
'val3' => '6',
),
array(
'val1' => '7',
'val2' => '8',
'val3' => '9',
),
);
$docx->replaceTableVariable($data, array('parseLineBreaks' => true));
$docx->createDocx('example_replaceTableVariable_1');
The number of rows I do not know in advance. Those. is N-lines. Then he will go again connected cells, then again a lot of lines, etc.