Snippets
- Learn phpdocx in 5 minutes
- Practical guide
- 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
- JavaScript API
- JSON API
- Artificial Intelligence
- Compiled mode
- Blockchain for documents
Clone blocks replacing placeholders
When cloning blocks with the cloneBlock method, you may replace the placeholders of the cloned blocks. There are two different approaches to do it:
- Using the available replacement options of the cloneBlock method itself. These options allow to replace the placeholders with texts or WordFragments at the same time the blocks are getting cloned.
- Using the firstMatch option. This one clones the blocks first and replace the placeholders afterwards.