$elements
$elements : array<mixed,\PhpOffice\PhpWord\Element\AbstractElement>
Elements collection
TextBox element
$elements : array<mixed,\PhpOffice\PhpWord\Element\AbstractElement>
Elements collection
$phpWord : \PhpOffice\PhpWord\PhpWord
PhpWord object
$docPart : string
Document part type: Section|Header|Footer|Footnote|Endnote
Used by textrun and cell container to determine where the element is located because it will affect the availability of other element, e.g. footnote will not be available when $docPart is header or footer.
$commentRangeStart : \PhpOffice\PhpWord\Element\Comment
The start position for the linked comment
$commentRangeEnd : \PhpOffice\PhpWord\Element\Comment
The end position for the linked comment
$parent : \PhpOffice\PhpWord\Element\AbstractElement
A reference to the parent
$trackChange : \PhpOffice\PhpWord\Element\TrackChange
changed element info
$style : \PhpOffice\PhpWord\Style\TextBox
TextBox style
__call(mixed $function, mixed $args) : \PhpOffice\PhpWord\Element\AbstractElement
Magic method to catch all 'addElement' variation
This removes addText, addTextRun, etc. When adding new element, we have to
add the model in the class docblock with @method
.
Warning: This makes capitalization matters, e.g. addCheckbox or addcheckbox won't work.
mixed | $function | |
mixed | $args |
getElements() : array<mixed,\PhpOffice\PhpWord\Element\AbstractElement>
Get all elements
getElement(integer $index) : \PhpOffice\PhpWord\Element\AbstractElement|null
Returns the element at the requested position
integer | $index |
removeElement(integer|\PhpOffice\PhpWord\Element\AbstractElement $toRemove)
Removes the element at requested index
integer|\PhpOffice\PhpWord\Element\AbstractElement | $toRemove |
createTextRun(mixed $paragraphStyle = null) : \PhpOffice\PhpWord\Element\TextRun
Create textrun element
mixed | $paragraphStyle |
createFootnote(mixed $paragraphStyle = null) : \PhpOffice\PhpWord\Element\Footnote
Create footnote element
mixed | $paragraphStyle |
codeCoverageIgnore |
---|
getPhpWord() : \PhpOffice\PhpWord\PhpWord
Get PhpWord
None found |
setPhpWord(\PhpOffice\PhpWord\PhpWord $phpWord = null)
Set PhpWord as reference.
\PhpOffice\PhpWord\PhpWord | $phpWord |
None found |
None found |
setDocPart(string $docPart, integer $docPartId = 1)
Set doc part.
string | $docPart | |
integer | $docPartId |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
None found |
getCommentRangeStart() : \PhpOffice\PhpWord\Element\Comment
Get comment start
None found |
setCommentRangeStart(\PhpOffice\PhpWord\Element\Comment $value)
Set comment start
\PhpOffice\PhpWord\Element\Comment | $value |
None found |
getCommentRangeEnd() : \PhpOffice\PhpWord\Element\Comment
Get comment end
None found |
setCommentRangeEnd(\PhpOffice\PhpWord\Element\Comment $value)
Set comment end
\PhpOffice\PhpWord\Element\Comment | $value |
None found |
None found |
setParentContainer(\PhpOffice\PhpWord\Element\AbstractElement $container)
Set parent container
Passed parameter should be a container, except for Table (contain Row) and Row (contain Cell)
\PhpOffice\PhpWord\Element\AbstractElement | $container |
None found |
isInSection() : boolean
Check if element is located in Section doc part (as opposed to Header/Footer)
None found |
setTrackChange(\PhpOffice\PhpWord\Element\TrackChange $trackChange)
Sets the trackChange information
\PhpOffice\PhpWord\Element\TrackChange | $trackChange |
None found |
getTrackChange() : \PhpOffice\PhpWord\Element\TrackChange
Gets the trackChange information
None found |
setChangeInfo(string $type, string $author, null|integer|\DateTime $date = null)
Set changed
string | $type | INSERTED|DELETED |
string | $author | |
null|integer|\DateTime | $date | allways in UTC |
None found |
None found |
getStyle() : \PhpOffice\PhpWord\Style\TextBox
Get textbox style
None found |
addText(string $text, mixed $fStyle = null, mixed $pStyle = null) : \PhpOffice\PhpWord\Element\Text
string | $text | |
mixed | $fStyle | |
mixed | $pStyle |
None found |
addTextRun(mixed $pStyle = null) : \PhpOffice\PhpWord\Element\TextRun
mixed | $pStyle |
None found |
addBookmark(string $name) : \PhpOffice\PhpWord\Element\Bookmark
string | $name |
None found |
addLink(string $target, string $text = null, mixed $fStyle = null, mixed $pStyle = null, boolean $internal = false) : \PhpOffice\PhpWord\Element\Link
string | $target | |
string | $text | |
mixed | $fStyle | |
mixed | $pStyle | |
boolean | $internal |
None found |
addPreserveText(string $text, mixed $fStyle = null, mixed $pStyle = null) : \PhpOffice\PhpWord\Element\PreserveText
string | $text | |
mixed | $fStyle | |
mixed | $pStyle |
None found |
addTextBreak(integer $count = 1, mixed $fStyle = null, mixed $pStyle = null) : void
integer | $count | |
mixed | $fStyle | |
mixed | $pStyle |
None found |
addListItem(string $txt, integer $depth, mixed $font = null, mixed $list = null, mixed $para = null) : \PhpOffice\PhpWord\Element\ListItem
string | $txt | |
integer | $depth | |
mixed | $font | |
mixed | $list | |
mixed | $para |
None found |
addListItemRun(integer $depth, mixed $listStyle = null, mixed $pStyle = null) : \PhpOffice\PhpWord\Element\ListItemRun
integer | $depth | |
mixed | $listStyle | |
mixed | $pStyle |
None found |
addFootnote(mixed $pStyle = null) : \PhpOffice\PhpWord\Element\Footnote
mixed | $pStyle |
None found |
addEndnote(mixed $pStyle = null) : \PhpOffice\PhpWord\Element\Endnote
mixed | $pStyle |
None found |
addCheckBox(string $name, mixed $text, mixed $fStyle = null, mixed $pStyle = null) : \PhpOffice\PhpWord\Element\CheckBox
string | $name | |
mixed | $text | |
mixed | $fStyle | |
mixed | $pStyle |
None found |
addTitle(string $text, integer $depth = 1) : \PhpOffice\PhpWord\Element\Title
string | $text | |
integer | $depth |
None found |
addTOC(mixed $fontStyle = null, mixed $tocStyle = null, integer $minDepth = 1, integer $maxDepth = 9) : \PhpOffice\PhpWord\Element\TOC
mixed | $fontStyle | |
mixed | $tocStyle | |
integer | $minDepth | |
integer | $maxDepth |
None found |
addPageBreak() : \PhpOffice\PhpWord\Element\PageBreak
None found |
addTable(mixed $style = null) : \PhpOffice\PhpWord\Element\Table
mixed | $style |
None found |
addImage(string $source, mixed $style = null, boolean $isWatermark = false, mixed $name = null) : \PhpOffice\PhpWord\Element\Image
string | $source | |
mixed | $style | |
boolean | $isWatermark | |
mixed | $name |
None found |
addOLEObject(string $source, mixed $style = null) : \PhpOffice\PhpWord\Element\OLEObject
string | $source | |
mixed | $style |
None found |
addTextBox(mixed $style = null) : \PhpOffice\PhpWord\Element\TextBox
mixed | $style |
None found |
addField(string $type = null, array $properties = array() : \PhpOffice\PhpWord\Element\Field
, array $options = array(), mixed $text = null)
string | $type | |
array | $properties |
None found |
addLine(mixed $lineStyle = null) : \PhpOffice\PhpWord\Element\Line
mixed | $lineStyle |
None found |
addShape(string $type, mixed $style = null) : \PhpOffice\PhpWord\Element\Shape
string | $type | |
mixed | $style |
None found |
addChart(string $type, array $categories, array $values, array $style = null) : \PhpOffice\PhpWord\Element\Chart
string | $type | |
array | $categories | |
array | $values | |
array | $style |
None found |
addFormField(string $type, mixed $fStyle = null, mixed $pStyle = null) : \PhpOffice\PhpWord\Element\FormField
string | $type | |
mixed | $fStyle | |
mixed | $pStyle |
None found |
addSDT(string $type) : \PhpOffice\PhpWord\Element\SDT
string | $type |
None found |
addObject(string $source, mixed $style = null) : \PhpOffice\PhpWord\Element\OLEObject
deprecated, use addOLEObject instead
string | $source | |
mixed | $style |
None found |
addElement(string $elementName) : \PhpOffice\PhpWord\Element\AbstractElement
Add element
Each element has different number of parameters passed
string | $elementName |
None found |
setNewStyle(mixed $styleObject, mixed $styleValue = null, boolean $returnObject = false) : mixed
Set new style value
mixed | $styleObject | Style object |
mixed | $styleValue | Style value |
boolean | $returnObject | Always return object |
None found |
setEnumVal(string|null $value = null, array<mixed,string> $enum = array(), string|null $default = null) : string|null
Set enum value
string|null | $value | |
array<mixed,string> | $enum | |
string|null | $default |
todo |
Merge with the same method in AbstractStyle |
---|
checkValidity(string $method) : boolean
Check if a method is allowed for the current container
string | $method |
None found |
getMediaPart() : string
Return media element (image, object, link) container name
section|headerx|footerx|footnote|endnote
None found |
setMediaRelation()
Set relation Id for media elements (link, image, object; legacy of OOXML)
None found |
setCollectionRelation()
Set relation Id for elements that will be registered in the Collection subnamespaces.
None found |