Forum


Replies: 1   Views: 811
Cannot get template variables
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 php_spacewell  · 22-04-2022 - 13:05

Hi

I have created and object using "

CreateDocxFromTemplate

and supplied the template file to it.

After some processing replaced some table contents using "replaceTableVariable" function and saved the file.

Now in my above replacement some of table variable is again replaced with new image tags.

Now I want to fetch those newly created tags but Its not happening.

 

Posted by admin  · 22-04-2022 - 14:21

Hello,

Please try using the processTemplate method (https://www.phpdocx.com/api-documentation/templates/proccess-a-word-docx-template) after loading a template:

$docx = new CreateDocxFromTemplate('document.docx');
$docx->processTemplate();

We have done some tests generating and loading multiple DOCX in the same script (using and not using the processTemplate method) and everything is working correctly in all cases.

For further support, please send to contact[at]phpdocx.com the most simple code and template that illustrate your issue (without doing external connections such as databases or web services) and we'll check them, maybe there's some issue in the code you are running.

Regards.