addList

addList

BASIC / ADVANCED / PREMIUM

Inserts a list into the PowerPoint presentation.

Description
public addList($contents, $position, $listStyles = array(), $options = array())

This method inserts lists into the PowerPoint presentation.

Parameters

contents

Array of text contents and styles. PptxFragments can be used to add contents.

Key Type Description
text string|array See addText for text styles.
bold bool
characterSpacing int
color string HEX color.
font string Font family.
fontSize int 8, 9, 10, 11...
highlight string HEX color.
italic bool
lang string Language.
strikethrough bool
underline string Underline: single.

position

Key Type Description
placeholder array

The content is added in a placeholder of the layout. One of the following options can be used to get the text box.

  • 'name' (string) placeholder name.
  • 'descr' (string) placeholder alt text (descr) value.
  • 'position' (int) placeholder position by order. 0 is the first order position.
  • 'type' (string) title (Title), body (Body), ctrTitle (Centered Title), subTitle (Subtitle).
new array

A new position is generated.

  • 'coordinateX' (int) EMUs (English Metric Unit).
  • 'coordinateY' (int) EMUs (English Metric Unit).
  • 'sizeX' (int) EMUs (English Metric Unit).
  • 'sizeY' (int) EMUs (English Metric Unit).
  • 'name' (string) placeholder internal name. If not set, a random name is generated.
  • 'order' (int) set the display order. Default after existing contents. 0 is the first order position. If the order position doesn't exist add after existing contents.
  • 'textBoxStyles' (array) See addTextBox for text box styles.

listStyles

Array for each list level.

Key Type Description
color string HEX color.
font string Font family.
indent int EMUs (English Metric Unit) default as -250000.
marginLeft int EMUs (English Metric Unit).
marginRight int EMUs (English Metric Unit).
size int % of text.
startAt int Start at value.
type array
  • 'filledRoundBullet'
  • 'hollowRoundBullet'
  • 'filledSquareBullet'
  • 'hollowSquareBullet'
  • 'starBullet'
  • 'arrowBullet'
  • 'checkmarkBullet'
  • 'decimal'
  • 'romanUpperCase'
  • 'romanLowerCase'
  • 'alphaUpperCase'
  • 'alphaLowerCase'
  • 'alphaLcParenBoth'
  • 'alphaUcParenBoth'
  • 'alphaLcParenR'
  • 'alphaUcParenR'
  • 'alphaLcPeriod'
  • 'alphaUcPeriod'
  • 'arabicParenBoth'
  • 'arabicParenR'
  • 'arabicPeriod'
  • 'arabicPlain'
  • 'romanLcParenBoth'
  • 'romanUcParenBoth'
  • 'romanLcParenR'
  • 'romanUcParenR'
  • 'romanLcPeriod'
  • 'romanUcPeriod'
  • 'circleNumDbPlain'
  • 'circleNumWdBlackPlain'
  • 'circleNumWdWhitePlain'
  • 'arabicDbPeriod'
  • 'arabicDbPlain'
  • 'ea1ChsPeriod'
  • 'ea1ChsPlain'
  • 'ea1ChtPlain'
  • 'ea1JpnChsDbPeriod'
  • 'ea1JpnKorPlain'
  • 'ea1JpnKorPeriod'
  • 'arabic1Minus'
  • 'arabic2Minus'
  • 'hebrew2Minus'
  • 'thaiAlphaPeriod'
  • 'thaiAlphaParenR'
  • 'thaiAlphaParenBoth'
  • 'thaiNumPeriod'
  • 'thaiNumParenR'
  • 'thaiNumParenBoth'
  • 'hindiAlphaPeriod'
  • 'hindiNumPeriod'
  • 'hindiNumParenR'
  • 'hindiAlpha1Period'

options

Key Type Description
insertMode string

Insert mode if the position contains an existing content:

  • append
  • replace

Default as append.

Exceptions

Position not valid.

Code samples

Example #1

The resulting PPTX looks like:

Example #2

The resulting PPTX looks like:

Example #3

The resulting PPTX looks like:

Release notes
  • phppptx 1.0:
    • new method.