setTemplateSymbol

setTemplateSymbol

BASIC / ADVANCED / PREMIUM

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

Description
public setTemplateSymbol($templateSymbolStart = '$', $templateSymbolEnd = null, $options = array())

By default the phppptx 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.

The character or symbol used to wrap template variables may be:

  • The same at the beginning and the end (setting only $templateSymbolStart): $VAR$, #VAR#...
  • Different at the beginning and the end: ${VAR}.

Parameters

templateSymbolStart

The character or symbol to be used for identifying placeholder variables within templates. If templateSymbolEnd is null, it uses templateSymbolStart at the beginning and the end of the variable.

templateSymbolEnd

The character or symbol to be used at the end for identifying placeholder variables within templates. If null, it uses templateSymbolStart at the beginning and the end of the variable. If it has a value, it uses templateSymbolStart at the beginning and templateSymbolEnd at the end.

options

The possible keys and values of this array are:

Key Type Description
preprocessed bool Set the template as preprocessed. Default as false.
Code samples

Example #1

Release notes
  • phppptx 4.0:
    • preprocessed option.
  • phppptx 1.0:
    • new method.