Snippets

Adding more than one content into a single WordFragment as block elements

x
 
1
$contentFragment = new WordFragment($docx);
2
3
// add as many contents as needed to the same WordFragment: text, images, links, charts, tables, lists...
4
$contentFragment->addText(...);
5
$contentFragment->addTable(...);
6
$contentFragment->addText(...);
7
$contentFragment->addHeading(...);
8
$contentFragment->addList(...);
9

The WordFragment created can be added as new content in the document or placed in templates by replacing placeholders with the relevant methods.

­
­