addCitation

addCitation

ADVANCED / PREMIUM TRIAL

Inserts a citation into the Word document.

Description
public addCitation ( string $tagName [, array $fields = array('Author', 'Title', 'Year') [, array $options = array()]] )

This method allows to insert citations into a Word document.

Parameters

tagName

Source tag name.

fields

Fields to be displayed.

options

Key Type Description
markCitation array

Marks a citation:

  • categoryNumber (int): default as 1
  • text (string): text content

Check addText options to apply styles to citations (font, bold, italic, color, fontSize, underline, rStyle, characterBorder).

Exceptions

Method not available.

Code samples

Example #1

The resulting Word document looks like:

Release notes
  • phpdocx 16.0:
    • markCitation option.
    • characterBorder, rStyle styles.
  • phpdocx 12.0:
    • new method.