replaceVariableList

replaceVariableList

BASIC / ADVANCED / PREMIUM

Replaces a single variable within a list by a list of items.

Description
public replaceVariableList($variable, $listValues, $options = array())

This method replaces a single variable within a list by a list of items.

If one includes the placeholder variable as a list item phppptx will clone that entry the required number of times and populate the resulting items with the values provided by the $listValues array.

Parameters

variable

The name of the variable that you want to replace by a list of items.

listValues

The array with the values to populate the list.

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.
target string slides (default), slideLayouts, slideMasters.
Code samples

Example #1

The resulting PPTX looks like:

Release notes
  • phppptx 3.0:
    • target option.
  • phppptx 2.0:
    • PptxFragment as content values.
  • phppptx 1.0:
    • new method.