First, thanks for this API, it is so usefull :)
However, an important function isn't present. Indeed, we can not merge templates. For instance, the following code only import the last template in the document generated by the API:
[code]<?php
require_once '../../classes/CreateDocx.inc';
$docx = new CreateDocx();
$docx->addTemplate('template1.docx');
$docx->addTemplateVariable('var1', 'value1');
$docx->addTemplate('template2.docx');
$docx->addTemplateVariable('var2', 'value2');
$docx->createDocx('testdoc.docx');
?>[/code]
Is there a solution to merge templates or add text after (or before) a template ?
[code]<?php
require_once '../../classes/CreateDocx.inc';
$docx = new CreateDocx();
$docx->addTemplate('template1.docx');
$docx->addTemplateVariable('var1', 'value1');
$text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' .
'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' .
'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' .
'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' .
'in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' .
'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui ' .
'officia deserunt mollit anim id est laborum.';
$paramsText = array(
'b' => 'single',
'font' => 'Arial'
);
$docx->addText($text, $paramsText);
$docx->createDocx('testdoc.docx');
?>[/code]
Only the template is generated, not the text.
Best regards,