Forum


Replies: 1   Views: 4753
Remove line where empty variable was
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  · 29-09-2016 - 06:56

Hello,

We recommend you to check the included example in the folder Templates/removeTemplateVariable.

When you write the placeholder you don't write the symbols that wrap the placeholders. You need to remove placeholder using this line:

$docx->removeTemplateVariable('OTHERVAR', 'block');

and not:

$docx->removeTemplateVariable('$OTHERVAR$', 'block');

Also please check that your script is running correctly and doesn't have any error; maybe this is not correct and the removeTemplateVariable method is not being called:

if(strlen($varValue) == 0) 

Regards.