PhpWord
in package
PHPWord main class.
Table of Contents
Properties
- $collections : array<string|int, mixed>
- Collections.
- $metadata : array<string|int, mixed>
- Metadata.
- $sections : array<string|int, Section>
- Collection of sections.
Methods
- __call() : mixed
- Dynamic function call to reduce static dependency.
- __construct() : mixed
- Create new instance.
- addBookmark() : int
- addChart() : int
- addComment() : int
- addEndnote() : int
- addFontStyle() : Font
- addFootnote() : int
- addLinkStyle() : Font
- addNumberingStyle() : Numbering
- addParagraphStyle() : Paragraph
- addSection() : Section
- Create new section.
- addTableStyle() : Table
- addTitle() : int
- addTitleStyle() : Font
- createSection() : Section
- Create new section.
- getCharts() : Charts
- getComments() : Comments
- getCompatibility() : Compatibility
- Get compatibility.
- getDefaultFontName() : string
- Get default font name.
- getDefaultFontSize() : int
- Get default font size.
- getDocInfo() : DocInfo
- Get document properties object.
- getDocumentProperties() : DocInfo
- Get document properties object.
- getEndnotes() : Endnotes
- getFootnotes() : Footnotes
- getSection() : null|Section
- Returns the section at the requested position.
- getSections() : array<string|int, Section>
- Get all sections.
- getSettings() : Settings
- Get compatibility.
- getTitles() : Titles
- save() : bool
- Save to file or download.
- setDefaultFontName() : void
- Set default font name.
- setDefaultFontSize() : void
- Set default font size.
- setDefaultParagraphStyle() : Paragraph
- Set default paragraph style definition to styles.xml.
- setDocumentProperties() : self
- Set document properties object.
- sortSections() : void
- Sorts the sections using the callable passed.
Properties
$collections
Collections.
private
array<string|int, mixed>
$collections
= []
$metadata
Metadata.
private
array<string|int, mixed>
$metadata
= []
Tags
$sections
Collection of sections.
private
array<string|int, Section>
$sections
= []
Methods
__call()
Dynamic function call to reduce static dependency.
public
__call(mixed $function, mixed $args) : mixed
Parameters
- $function : mixed
- $args : mixed
Tags
__construct()
Create new instance.
public
__construct() : mixed
Collections are created dynamically
addBookmark()
public
addBookmark([Bookmark $bookmark = ]) : int
Parameters
- $bookmark : Bookmark =
Return values
intaddChart()
public
addChart([Chart $chart = ]) : int
Parameters
- $chart : Chart =
Return values
intaddComment()
public
addComment([Comment $comment = ]) : int
Parameters
- $comment : Comment =
Return values
intaddEndnote()
public
addEndnote([Endnote $endnote = ]) : int
Parameters
- $endnote : Endnote =
Return values
intaddFontStyle()
public
addFontStyle([string $styleName = ][, mixed $fontStyle = ][, mixed $paragraphStyle = null ]) : Font
Parameters
- $styleName : string =
- $fontStyle : mixed =
- $paragraphStyle : mixed = null
Return values
FontaddFootnote()
public
addFootnote([Footnote $footnote = ]) : int
Parameters
- $footnote : Footnote =
Return values
intaddLinkStyle()
public
addLinkStyle([string $styleName = ][, mixed $styles = ]) : Font
Parameters
- $styleName : string =
- $styles : mixed =
Return values
FontaddNumberingStyle()
public
addNumberingStyle([string $styleName = ][, mixed $styles = ]) : Numbering
Parameters
- $styleName : string =
- $styles : mixed =
Return values
NumberingaddParagraphStyle()
public
addParagraphStyle([string $styleName = ][, mixed $styles = ]) : Paragraph
Parameters
- $styleName : string =
- $styles : mixed =
Return values
ParagraphaddSection()
Create new section.
public
addSection([null|array<string|int, mixed>|string $style = null ]) : Section
Parameters
- $style : null|array<string|int, mixed>|string = null
Return values
SectionaddTableStyle()
public
addTableStyle([string $styleName = ][, mixed $styleTable = ][, mixed $styleFirstRow = null ]) : Table
Parameters
- $styleName : string =
- $styleTable : mixed =
- $styleFirstRow : mixed = null
Return values
TableaddTitle()
public
addTitle([Title $title = ]) : int
Parameters
- $title : Title =
Return values
intaddTitleStyle()
public
addTitleStyle([mixed $depth = ][, mixed $fontStyle = ][, mixed $paragraphStyle = null ]) : Font
Parameters
- $depth : mixed =
- $fontStyle : mixed =
- $paragraphStyle : mixed = null
Return values
FontcreateSection()
Create new section.
public
createSection([array<string|int, mixed> $settings = null ]) : Section
Parameters
- $settings : array<string|int, mixed> = null
Tags
Return values
SectiongetCharts()
public
getCharts() : Charts
Return values
ChartsgetComments()
public
getComments() : Comments
Return values
CommentsgetCompatibility()
Get compatibility.
public
getCompatibility() : Compatibility
Tags
Return values
CompatibilitygetDefaultFontName()
Get default font name.
public
getDefaultFontName() : string
Return values
stringgetDefaultFontSize()
Get default font size.
public
getDefaultFontSize() : int
Return values
intgetDocInfo()
Get document properties object.
public
getDocInfo() : DocInfo
Return values
DocInfogetDocumentProperties()
Get document properties object.
public
getDocumentProperties() : DocInfo
Tags
Return values
DocInfogetEndnotes()
public
getEndnotes() : Endnotes
Return values
EndnotesgetFootnotes()
public
getFootnotes() : Footnotes
Return values
FootnotesgetSection()
Returns the section at the requested position.
public
getSection(int $index) : null|Section
Parameters
- $index : int
Return values
null|SectiongetSections()
Get all sections.
public
getSections() : array<string|int, Section>
Return values
array<string|int, Section>getSettings()
Get compatibility.
public
getSettings() : Settings
Tags
Return values
SettingsgetTitles()
public
getTitles() : Titles
Return values
Titlessave()
Save to file or download.
public
save(string $filename[, string $format = 'Word2007' ][, bool $download = false ]) : bool
All exceptions should already been handled by the writers
Parameters
- $filename : string
- $format : string = 'Word2007'
- $download : bool = false
Return values
boolsetDefaultFontName()
Set default font name.
public
setDefaultFontName(string $fontName) : void
Parameters
- $fontName : string
setDefaultFontSize()
Set default font size.
public
setDefaultFontSize(int $fontSize) : void
Parameters
- $fontSize : int
setDefaultParagraphStyle()
Set default paragraph style definition to styles.xml.
public
setDefaultParagraphStyle(array<string|int, mixed> $styles) : Paragraph
Parameters
- $styles : array<string|int, mixed>
-
Paragraph style definition
Return values
ParagraphsetDocumentProperties()
Set document properties object.
public
setDocumentProperties(DocInfo $documentProperties) : self
Parameters
- $documentProperties : DocInfo
Tags
Return values
selfsortSections()
Sorts the sections using the callable passed.
public
sortSections(callable $sorter) : void
Parameters
- $sorter : callable