Forum


Replies: 2   Views: 1725
Make replacetablevariable accept html
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  · 15-05-2020 - 15:56

Hello,

phpdocx 6.5 added support for using WordFragments in replaceListVariable and replaceTableVariable methods. You can create a WordFragment from HTML and add it as any other content.

Please check the included sample Templates/replaceTableVariable/sample_3.php that illustrates how to add WordFragments with replaceTableVariable. This sample adds link and image WordFragments, but you can create a WordFragment from almost any content, for example from HTML:

$htmlWordFragment = new WordFragment($docx);
$htmlWordFragment->embedHTML($html);

Regards.