modifyInputFields

modifyInputFields

TRIAL / ADVANCED / PREMIUM

Modifies the values associated with Word template input fields.

Description
public modifyInputFields (array $data, [array $options])

This method allows to modify the value of a series of Word input fields.

In combination with the tickCheckbox method allows to fill all data of a standard web form.

This method is also compatible with Word legacy input fields.

Parameters

data

An array with the names of the input fields as keys and their corresponding values.

options

The possible keys and values of this array are:

Key Type Description
target string Possible values are: document (default), header, footer. This option sets the scope of the replacement procedure.
Code samples

Example #1

The resulting Word document looks like:

Release notes
  • phpdocx 14.0:
    • header and footer as targets.
  • phpdocx 12.0:
    • htmlspecialchars applied in values.