XmlApi - pdx:setTemplateSymbol

pdx:setTemplateSymbol

Sets the character used to identify placeholder variables within a given template.

Note

You are reading the XMLAPI documentation. For the API method please go to setTemplateSymbol.

Description

Element definition

By default the phpdocx template variables have to be wrapped by dollar symbols ($).

You can change that symbol by any other you wish with the help of this method. It is, of course, convenient to use a symbol reasonably distinguishable from standard text characters.

Make sure that all variables in your template are surrounded by the symbol you have chosen.

Attributes and sub-elements

symbolValue

The symbol you want to use for identifying placeholder variables within templates.

Code samples

Example #1

config.xml

content.xml

settings.xml

PHP code

The resulting Word document looks like: