Snippets
- Learn phpdocx in 5 minutes
- Tutorial
- API quick guide
- HTML to Word
- HTML Extended
- Conversion plugin
- Word to HTML
- DOCXPath
- Bulk processing
- DOCXCustomizer
- Digital signature
- Cryptophpdocx
- Right to left languages
- phpdocx CLI command
- Tracking
- Artificial Intelligence
- Blockchain for documents
- JavaScript API
- Compiled mode
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.