replaceVariableTable

replaceVariableTable

BASIC / ADVANCED / PREMIUM

Replaces a group of variables within a set of table rows.

Description
public replaceVariableTable($variables, $options = array())

This method replaces a group of variables within a set of table rows.

If one includes a set of placeholder variables in a set of rows phppptx wil clone those rows the required number of times and populate the variables with the provided values.

Parameters

variables

Array of associative arrays. The keys of the associative array should match the names of the variables to replace by their corresponding 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.
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.