Forum


Replies: 2   Views: 3731
Populating bullet points via template
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 nicks  · 26-05-2015 - 16:22

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!

Posted by admin  · 26-05-2015 - 17:59

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.

Posted by nicks  · 27-05-2015 - 16:15

Thanks, replaceListVariable was just what I needed!