XMLWriter extends XMLWriter
XMLWriter.
Table of Contents
- STORAGE_DISK = 2
- STORAGE_MEMORY = 1
- Temporary storage method
- $tempFileName : string
- Temporary filename.
- __construct() : mixed
- Create a new \PhpOffice\PhpWord\Shared\XMLWriter instance.
- __destruct() : mixed
- Destructor.
- endElement() :
- flush() :
- getData() : string
- Get written data.
- openMemory() :
- outputMemory() :
- setIndent() :
- startDocument() :
- startElement() :
- text() :
- writeAttribute() : bool
- writeAttributeIf() : void
- Write attribute if .
- writeCData() :
- writeComment() :
- writeElement() :
- writeElementBlock() : void
- Write simple element and attribute(s) block.
- writeElementIf() : void
- Write element if .
- writeRaw() :
Constants
STORAGE_DISK
public
mixed
STORAGE_DISK
= 2
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
Return values
mixed —__destruct()
Destructor.
public
__destruct() : mixed
Return values
mixed —endElement()
public
endElement() :
Return values
—flush()
public
flush(bool $empty = null) :
Parameters
- $empty = null : bool
Return values
—getData()
Get written data.
public
getData() : string
Return values
string —openMemory()
public
openMemory() :
Return values
—outputMemory()
public
outputMemory(bool $flush = null) :
Parameters
- $flush = null : bool
Return values
—setIndent()
public
setIndent(bool $indent) :
Parameters
- $indent : bool
Return values
—startDocument()
public
startDocument(string $version = 1.0, string $encoding = null, string $standalone = null) :
Parameters
- $version = 1.0 : string
- $encoding = null : string
- $standalone = null : string
Return values
—startElement()
public
startElement(string $name) :
Parameters
- $name : string
Return values
—text()
public
text(string $content) :
Parameters
- $content : string
Return values
—writeAttribute()
public
writeAttribute(string $name, mixed $value) : bool
Parameters
- $name : string
- $value : mixed
Return values
bool —writeAttributeIf()
Write attribute if .
public
writeAttributeIf(bool $condition, string $attribute, mixed $value) : void
..
Parameters
- $condition : bool
- $attribute : string
- $value : mixed
Return values
void —writeCData()
public
writeCData(string $content) :
Parameters
- $content : string
Return values
—writeComment()
public
writeComment(string $content) :
Parameters
- $content : string
Return values
—writeElement()
public
writeElement(string $name, string $content = null) :
Parameters
- $name : string
- $content = null : string
Return values
—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:
- If the
$attributesis an array, then it's an associative array of attributes - If not, then it's a simple attribute-value pair
Parameters
- $element : string
- $attributes : array<string|int, mixed>|string
- $value : string = null
Return values
void —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
Return values
void —writeRaw()
public
writeRaw(string $content) :
Parameters
- $content : string