replaceVariableHtml
- getTemplateVariables
- getTemplateVariablesType
- processTemplate
- removeVariableAudio
- removeVariableImage
- removeVariableText
- removeVariableVideo
- replaceVariableAudio
- replaceVariableHtml
- replaceVariableImage
- replaceVariableList
- replaceVariablePptxFragment
- replaceVariableTable
- replaceVariableText
- replaceVariableVideo
- setTemplateSymbol
replaceVariableHtml
BASIC / ADVANCED / PREMIUM
Replaces placeholder variables with HTML.
This method replaces text placeholders with HTML/CSS contents.
To embed accents and other non-ASCII characters such as á or ü, and symbols such as ∞ or Ω, please check that the PHP Tidy extension and the PHP mbstring extension are installed and enabled.
If PHP Tidy can't be installed on the server, the forceNotTidy option can be enabled to transform HTML without using PHP Tidy. Please check Tips to convert HTML to PPTX (Transforming HTML without Tidy section) for more information.
Remember that the phppptx template variables should be surrounded by $ symbols or whatever symbol you have chosen via the setTemplateSymbol method.
variables
Array with the names of the placeholder template variables as keys and the HTML and CSS that should replace them as values.
options
The possible keys and values of this array are:
| Key | Type | Description |
|---|---|---|
| activeSlide | bool | If true, get only the active slide. Default as false. |
| forceNotTidy | bool | Default as false. If true, avoid using Tidy. Only recommended if Tidy can't be installed. |
| parseCSSVars | bool | If true parses CSS variables. |
| target | string |
|
| type | string |
|
PHP Tidy is not enabled.
Not valid PptxFragment.
- phppptx 4.0:
- improved adding alpha color styles.
- supported #rgba format to apply colors.
- forceNotTidy option.
- phppptx 3.5:
- list tags (ul, ol, li).
- improved handle br tags.
- phppptx 3.0:
- CSS variables.
- root and only-child selectors.
- improved CSS media query handling.
- CSS 8-digit HEX colors added as 6-digit HEX colors.
- notesSlides, slideLayouts and slideMasters targets.
- phppptx 2.5:
- new method.