Forum


Replies: 7   Views: 4112
Docx template
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  · 25-02-2016 - 16:24

Hello,

The methods addTemplate and addTemplateVariable doesn't exist in phpdocx 5, only in phpdocx 3 and previous versions. With phpdocx 5 you need to use the CreateDocxFromTemplate class to open the DOCX template and then use addTable (http://www.phpdocx.com/api-documentation/word-content/add-table-Word-document-with-PHP) to add a new table at the end of the document or replaceVariableByWordFragment (http://www.phpdocx.com/api-documentation/templates/replace-variable-word-fragment-Word-document) to replace a placeholder by a table.

Regards.