getTemplateVariablesType

getTemplateVariablesType

ADVANCED / PREMIUM BASIC

Returns the template placeholder variables and their types.

Description
public getTemplateVariablesType(string $target = 'all', array $options = array())

This method returns all phppptx placeholder variables of the current template and their types.

In order to work properly with this method, it is recommended not to use the symbol chosen for delimiting the placeholders in other contents of the presentation. It is preferable to use a unique symbol or ${} for placeholders.

To extract the placeholders, the public static variable CreatePptxFromTemplate::$regExprVariableSymbols is used. This variable contains a regular expression with the conditions to extract the variables, ([^ ]*) as default, so placeholders without empty spaces must be used to get them automatically with the getTemplateVariables method. If needed, this variable can be customized to use other regular expression.

Parameters

target

all (default), notesSlides, slides, slideLayouts, slideMasters.

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.
Return values

Array with the template variables and their types (text, table, image, audio, video) included in the PowerPoint template.

Exceptions

Method not available.

Code samples

Example #1

Release notes
  • phppptx 3.5:
    • new method.