Forum


Replies: 1   Views: 3433
Createdocxfromtemplate() with replacevariablebytext() generate invalid file
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 admin  · 26-05-2016 - 17:23

Hello,

Please send your template to contact[at]phpdocx.com and we'll check it. We have done some tests and everything is working fine, maybe there's some problem with the template that could be easily fixed.

UPDATE:

Thanks for the document. The problem is that paragraphs contain strings with the same name than the placeholders. Please use other placeholder names, such as:
 
$values = [
    'templateId' => 16,
    'templateName' => 'foobar',
    'templateOrder' => 1,
];
 
and it'll work fine.
 
Regards.