Documentation

XMLWriter extends XMLWriter
in package

XMLWriter.

Table of Contents

Constants

STORAGE_DISK  = 2
STORAGE_MEMORY  = 1
Temporary storage method

Properties

$tempFileName  : string
Temporary filename.

Methods

__construct()  : mixed
Create a new \PhpOffice\PhpWord\Shared\XMLWriter instance.
__destruct()  : mixed
Destructor.
endElement()  : bool
flush()  : mixed
getData()  : string
Get written data.
openMemory()  : bool
outputMemory()  : string
setIndent()  : bool
startDocument()  : bool
startElement()  : bool
text()  : bool
writeAttribute()  : bool
writeAttributeIf()  : void
Write attribute if .
writeCData()  : bool
writeComment()  : bool
writeElement()  : bool
writeElementBlock()  : void
Write simple element and attribute(s) block.
writeElementIf()  : void
Write element if .
writeRaw()  : bool

Constants

STORAGE_MEMORY

Temporary storage method

public mixed STORAGE_MEMORY = 1

Properties

$tempFileName

Temporary filename.

private string $tempFileName = ''

Methods

__construct()

Create a new \PhpOffice\PhpWord\Shared\XMLWriter instance.

public __construct([int $pTemporaryStorage = self::STORAGE_MEMORY ][, string $pTemporaryStorageDir = null ][, bool $compatibility = false ]) : mixed
Parameters
$pTemporaryStorage : int = self::STORAGE_MEMORY

Temporary storage location

$pTemporaryStorageDir : string = null

Temporary storage folder

$compatibility : bool = false

__destruct()

Destructor.

public __destruct() : mixed

endElement()

public endElement() : bool
Return values
bool

flush()

public flush([bool $empty = null ]) : mixed
Parameters
$empty : bool = null

getData()

Get written data.

public getData() : string
Return values
string

openMemory()

public openMemory() : bool
Return values
bool

outputMemory()

public outputMemory([bool $flush = null ]) : string
Parameters
$flush : bool = null
Return values
string

setIndent()

public setIndent([bool $indent = ]) : bool
Parameters
$indent : bool =
Return values
bool

startDocument()

public startDocument([string $version = 1.0 ][, string $encoding = null ][, string $standalone = null ]) : bool
Parameters
$version : string = 1.0
$encoding : string = null
$standalone : string = null
Return values
bool

startElement()

public startElement([string $name = ]) : bool
Parameters
$name : string =
Return values
bool

text()

public text([string $content = ]) : bool
Parameters
$content : string =
Return values
bool

writeAttribute()

public writeAttribute(string $name, mixed $value) : bool
Parameters
$name : string
$value : mixed
Attributes
#[ReturnTypeWillChange]
Return values
bool

writeAttributeIf()

Write attribute if .

public writeAttributeIf(bool $condition, string $attribute, mixed $value) : void

..

Parameters
$condition : bool
$attribute : string
$value : mixed

writeCData()

public writeCData([string $content = ]) : bool
Parameters
$content : string =
Return values
bool

writeComment()

public writeComment([string $content = ]) : bool
Parameters
$content : string =
Return values
bool

writeElement()

public writeElement([string $name = ][, string $content = null ]) : bool
Parameters
$name : string =
$content : string = null
Return values
bool

writeElementBlock()

Write simple element and attribute(s) block.

public writeElementBlock(string $element, array<string|int, mixed>|string $attributes[, string $value = null ]) : void

There are two options:

  1. If the $attributes is an array, then it's an associative array of attributes
  2. If not, then it's a simple attribute-value pair
Parameters
$element : string
$attributes : array<string|int, mixed>|string
$value : string = null

writeElementIf()

Write element if .

public writeElementIf(bool $condition, string $element[, string $attribute = null ][, mixed $value = null ]) : void

..

Parameters
$condition : bool
$element : string
$attribute : string = null
$value : mixed = null

writeRaw()

public writeRaw([string $content = ]) : bool
Parameters
$content : string =
Return values
bool

        
On this page

Search results