Documentation

Content extends AbstractPart

ODText content part writer: content.xml

Table of Contents

$dateFormat  : string
$parentWriter  : AbstractWriter
Parent writer
$autoStyles  : array<string|int, mixed>
Auto style collection
$imageParagraphStyles  : mixed
getParentWriter()  : AbstractWriter
Get parent writer
setParentWriter()  : mixed
Set parent writer.
write()  : string
Write part
getXmlWriter()  : XMLWriter
Get XML Writer
writeCommonRootAttributes()  : mixed
Write common root attributes.
writeFontFaces()  : mixed
Write font faces declaration.
writeText()  : bool
Write an XML text, this will call text() or writeRaw() depending on the value of Settings::isOutputEscapingEnabled()
collectTrackedChanges()  : mixed
Finds all tracked changes
getAutoStyles()  : mixed
Get automatic styles.
getContainerStyle()  : mixed
Get all styles of each elements in container recursively
getElementStyle()  : mixed
Get style of individual element
getElementStyleField()  : mixed
Get font style of individual field element
getElementStyleTextRun()  : mixed
Get style of individual element
writeAutoStyles()  : mixed
Write automatic styles other than fonts and paragraphs.
writeTextStyles()  : mixed
Write automatic styles.

Properties

$dateFormat

protected string $dateFormat = 'Y-m-d\TH:i:sP'

$autoStyles

Auto style collection

private array<string|int, mixed> $autoStyles = array('Section' => array(), 'Image' => array(), 'Table' => array())

Collect inline style information from section, image, and table elements

Tags
todo

Merge font and paragraph styles

$imageParagraphStyles

private mixed $imageParagraphStyles = array()

Methods

write()

Write part

public write() : string
Return values
string

writeCommonRootAttributes()

Write common root attributes.

protected writeCommonRootAttributes(XMLWriter $xmlWriter) : mixed
Parameters
$xmlWriter : XMLWriter
Return values
mixed

writeFontFaces()

Write font faces declaration.

protected writeFontFaces(XMLWriter $xmlWriter) : mixed
Parameters
$xmlWriter : XMLWriter
Return values
mixed

writeText()

Write an XML text, this will call text() or writeRaw() depending on the value of Settings::isOutputEscapingEnabled()

protected writeText(string $content) : bool
Parameters
$content : string

The text string to write

Return values
bool

Returns true on success or false on failure

getAutoStyles()

Get automatic styles.

private getAutoStyles(PhpWord $phpWord) : mixed
Parameters
$phpWord : PhpWord
Return values
mixed

getContainerStyle()

Get all styles of each elements in container recursively

private getContainerStyle(AbstractContainer $container, int &$paragraphStyleCount, int &$fontStyleCount) : mixed

Table style can be null or string of the style name

Parameters
$container : AbstractContainer
$paragraphStyleCount : int
$fontStyleCount : int
Tags
todo

Simplify the logic

Return values
mixed

getElementStyle()

Get style of individual element

private getElementStyle(Text $element, int &$paragraphStyleCount, int &$fontStyleCount) : mixed
Parameters
$element : Text
$paragraphStyleCount : int
$fontStyleCount : int
Return values
mixed

getElementStyleField()

Get font style of individual field element

private getElementStyleField(Field $element, int &$fontStyleCount) : mixed
Parameters
$element : Field
$fontStyleCount : int
Return values
mixed

getElementStyleTextRun()

Get style of individual element

private getElementStyleTextRun(TextRun $element, int &$paragraphStyleCount) : mixed
Parameters
$element : TextRun
$paragraphStyleCount : int
Return values
mixed

writeAutoStyles()

Write automatic styles other than fonts and paragraphs.

private writeAutoStyles(XMLWriter $xmlWriter) : mixed
Parameters
$xmlWriter : XMLWriter
Tags
since
0.11.0
Return values
mixed

writeTextStyles()

Write automatic styles.

private writeTextStyles(XMLWriter $xmlWriter) : mixed
Parameters
$xmlWriter : XMLWriter
Return values
mixed

Search results