Forum


Replies: 3   Views: 3206
Addtemplatevariable spacing
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 anmaier11  · 12-07-2012 - 11:03

Hello,

when i use addTemplateVariable, is it possible to erase spacing after a variable in case it is empty?

e.g. $ADDRESS$ $TITLE$ $NAME$

When $TITLE$ is empty, i have two spaces between address and name, there should be only one.


Andreas

Posted by admin  · 11-04-2013 - 12:13

Hello,

You could add a placeholder like $SPACE$ and replace or remove it. Or use only a placeholder in your template and replace it with a string generated by your code.

Regards.

Posted by anmaier11  · 11-04-2013 - 12:13

Hello,

thank you for your answer.

I tried to add a spacing after the value for a variable before replacing it, but in the output the spacing is erased.
How can force the output of a spacing at the end of a value?

Andreas