I need to dynamically create a table and i think this method is the best to fit my requirements but i was not able to figure how to declare this in the Word document (ps : i have the pro version)
[code]require_once 'classes/CreateDocx.inc';
$docx = new CreateDocx();
$docx->addTemplate('TemplateTable.docx');
$settings = array(
'header' => true
);
$docx->addTemplateVariable(
array(
array(
'NAME' => 'Product A',
'WEIGHT' => '10',
'PRICE' => '5',
),
array(
'NAME' => 'Product B',
'WEIGHT' => '20',
'PRICE' => '30',
),
array(
'NAME' => 'Product C',
'WEIGHT' => '25',
'PRICE' => '7',
),
),
'table',
$settings
);
$docx->addTemplateVariable('TOTALWEIGHT', '55');
$docx->addTemplateVariable('TOTALPRICE', '42');
$docx->addTemplateVariable('MYNAME', 'David Hume');
$docx->createDocx('template_table.docx');
[/code]