Replies: 2   Views: 3069
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 smaubian  · 10-11-2011 - 08:03

Any chance i can have the TemplateTable.docx file attached to this example ?

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/';

$docx = new CreateDocx();


$settings = array(
'header' => true

'NAME' => 'Product A',
'WEIGHT' => '10',
'PRICE' => '5',
'NAME' => 'Product B',
'WEIGHT' => '20',
'PRICE' => '30',
'NAME' => 'Product C',
'WEIGHT' => '25',
'PRICE' => '7',

$docx->addTemplateVariable('TOTALWEIGHT', '55');

$docx->addTemplateVariable('TOTALPRICE', '42');

$docx->addTemplateVariable('MYNAME', 'David Hume');