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.
I have downloaded latest version and was trying to replace DOCVariable field defined as $name$ but value was not get updated by $docx->replaceVariableByText() method.
When I dump variables using $docx->getTemplateVariables() method I can see $name$ listed as a variable but unable to replace it's value using replaceVariableByText() method.
Please let me know whether PhpDocX able to replace DOCVariable field variables defined as placeholders similar to $name$
Cheers,
Danesh
Edited by admin ·
01-10-2014 - 12:01 Hello,
The placehoders must be surrounded by '$'. If you prefer to use other symbol, you need to use the setTemplateSymbol method; the same symbol must be used at the start and end of the placeholder.
Please run the included example and check if the placeholders are replaced.
Regards.Hi Admin, Yes placeholders are already surrounded by '$' and it does replace normal text based placeholders at Word Document.
I am referring to DocVariables defined as quick part for example { DOCVARIABLE $variablename$ } that does NOT replace by PhpDocX
Can you please look in to this and if PhpDocX able to replace value of "DocVariable" we will definitely going to purchase the licensed version of PhpDocX for our web application.
Cheers,
Danesh
Hello,
No, DocVariables are not supported by phpdocx.
Regards.