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.
Hi All,
Been using PHPDOCX for a while now and it's been working rather well. Just upgraded to the latest version and having to rewrite a fair chunk of code.
This includes a bullet point that is populated with a dynamic number of items. Previously I just added a tag ($BLAH$) to the document template, and then used the addtemplatevariable with an array. e.g.
$docx->addTemplateVariable(BLAH, $BulletArray);
This no longer works, and I can't figure out how to do it with the replaceVariableByText, am I missing something obvious?
Thanks in advance!
Hello,
The addTemplateVariable method has been replaced by:
· replaceVariableByText
http://www.phpdocx.com/api-documentation/templates/replace-variable-text-Word-document
· replaceListVariable
http://www.phpdocx.com/api-documentation/templates/replace-list-variable-Word-document
· replaceTableVariable
http://www.phpdocx.com/api-documentation/templates/replace-table-variable-Word-document
And phpdocx 4 added this powerful method:
· replaceVariableByWordFragment
http://www.phpdocx.com/api-documentation/templates/replace-variable-word-fragment-Word-document
All pages included examples about how to use each method.
Regards.
Thanks, replaceListVariable was just what I needed!