Forum


Replies: 4   Views: 3857
Html and replacetablevariable
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 dthomas41  · 21-07-2015 - 05:25

We are currently evaluating phpdocx for replacing paper forms and need to embed HTML within tables in a template. The tutorial which explains how to do this no longer works. I tried the following code but it does not render anything in the cell marked $html$. $docx = new CreateDocxFromTemplate('../templates/test.docx'); $wf = new WordFragment($docx); $html = '
  • Item 1
  • Item 2
'; // My HTML was removed by the forum code. $htmlFragment = $wf->embedHTML($html); $data = array( array('name' => 'Example name', 'number' => 12345, 'html' => $htmlFragment) ); $docx->replaceTableVariable($data);