JSON API - replaceTableVariable
- addBarcode
- addBookmark
- addBreak
- addCaption
- addChart
- addComment
- addCrossReference
- addDateAndHour
- addDropCap
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addPageNumber
- addRuby
- addSimpleField
- addStructuredDocumentTag
- addSVG
- addTab
- addTable
- addTableContents
- addTableFigures
- addText
- addTextBox
- addWordML
- addWordFragment
- embedHTML
- addBackgroundImage
- addFooter
- addFooterSection
- addHeader
- addHeaderSection
- addLineNumbering
- addPageBorders
- addProperties
- addSection
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- modifyPageLayout
- removeFooters
- removeHeaders
- setBackgroundColor
- setCompatibilityMode
- setDefaultFont
- setDocumentDefaultStyles
- setLanguage
- setMarkAsFinal
- setRTL
- clearBlocks
- cloneBlock
- deleteBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- removeTemplateVariableImage
- replaceBlock
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHTML
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- setTemplateBlockSymbol
- tickCheckboxes
replaceTableVariable
PREMIUM
TRIAL / ADVANCED
Replaces a group of variables within a set of table rows.
Note
You are reading the JSON API documentation. For the PHP API method please go to replaceTableVariable.
JSON data
| Key | Description |
|---|---|
| variables | This has to be an array. The keys of the associative array should match the names of the variables that you want to replace by their corresponding values (text strings or WordFragments). |
| firstMatch | If the variable appears more than once within the Word document and firstMatch is set to true, phpdocx will only replace the first occurrence of the variable within the Word document. |
| target | Possible values are: document (default), header, footer. This option sets the scope of the replacement procedure. |
| parseLineBreaks | If true (default is false) parses the line breaks to include them in the Word document. |
| type | inline (default) or block; used by WordFragment values. |
| addExtraSiblingNodes | If true (default is false) parses and adds nodes that don't have placeholders between placeholders. |
| wordFragmentOptions |
|
Code samples
Example #1
A template can be a local file, a Base64 string, or a remote file.
Release notes
- phpdocx 18.0:
- new action.
