cloneBlock

cloneBlock

ADVANCED / PREMIUM BASIC

Clones a block in the document.

Description
public cloneBlock (string $blockName [, int $occurrence [, array $variablesBlock = array() [, array $options = array()]]])
Parameters

blockName

The block var.

occurrence

Position of the block to be cloned. 1 as default.

variablesBlock

This must be an array with the names of the placeholder block variables as keys and the plain text or WordFragment that should replace them as values.

options

The possible keys and values of this array are:

Key Type Description
removeBlockPlaceholder bool False as default. If true, remove block placeholders from the cloned content.
type string Possible values are: inline (default) or block. Used by WordFragment values.
Code samples

Example #1

The resulting Word document looks like:

Example #2

The resulting Word document looks like:

Example #3

The resulting Word document looks like: