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_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
__destruct()
Destructor.
public
__destruct() : mixed
endElement()
public
endElement() : bool
Return values
boolflush()
public
flush([bool $empty = null ]) : mixed
Parameters
- $empty : bool = null
getData()
Get written data.
public
getData() : string
Return values
stringopenMemory()
public
openMemory() : bool
Return values
booloutputMemory()
public
outputMemory([bool $flush = null ]) : string
Parameters
- $flush : bool = null
Return values
stringsetIndent()
public
setIndent([bool $indent = ]) : bool
Parameters
- $indent : bool =
Return values
boolstartDocument()
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
boolstartElement()
public
startElement([string $name = ]) : bool
Parameters
- $name : string =
Return values
booltext()
public
text([string $content = ]) : bool
Parameters
- $content : string =
Return values
boolwriteAttribute()
public
writeAttribute(string $name, mixed $value) : bool
Parameters
- $name : string
- $value : mixed
Attributes
- #[ReturnTypeWillChange]
Return values
boolwriteAttributeIf()
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
boolwriteComment()
public
writeComment([string $content = ]) : bool
Parameters
- $content : string =
Return values
boolwriteElement()
public
writeElement([string $name = ][, string $content = null ]) : bool
Parameters
- $name : string =
- $content : string = null
Return values
boolwriteElementBlock()
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
$attributes
is 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
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 =