Documentation

FormField extends Text
in package

Form field element.

Tags
since
0.12.0
see
http://www.datypic.com/sc/ooxml/t-w_CT_FFData.html

Table of Contents

Properties

$collectionRelation  : bool
Is part of collection; true for Title, Footnote, Endnote, Chart, and Comment.
$commentsRangeEnd  : Comments
The end position for the linked comments.
$commentsRangeStart  : Comments
The start position for the linked comments.
$docPart  : string
Document part type: Section|Header|Footer|Footnote|Endnote.
$docPartId  : int
Document part Id.
$elementId  : string
Unique Id for element.
$elementIndex  : int
Index of element in the elements collection (start with 1).
$fontStyle  : Font|string
Text style.
$mediaRelation  : bool
Has media relation flag; true for Link, Image, and Object.
$paragraphStyle  : Paragraph|string
Paragraph style.
$phpWord  : PhpWord|null
PhpWord object.
$relationId  : int
Relation Id.
$sectionId  : int
Section Id.
$text  : string|null
Text content.
$default  : bool|int|string
Default value.
$entries  : array<string|int, mixed>
Dropdown entries.
$name  : string|null
Form field name.
$nestedLevel  : int
Depth of table container nested level; Primarily used for RTF writer/reader.
$parent  : null|AbstractElement
A reference to the parent.
$parentContainer  : string
Parent container type.
$trackChange  : TrackChange
changed element info.
$type  : string
Form field type: textinput|checkbox|dropdown.
$value  : null|bool|int|string
Value.

Methods

__construct()  : mixed
Create new instance.
getCommentRangeEnd()  : Comment
Get comment end.
getCommentRangeStart()  : Comment
Get comment start.
getCommentsRangeEnd()  : Comments
Get comments end.
getCommentsRangeStart()  : Comments
Get comments start.
getDefault()  : bool|int|string
Get default.
getDocPart()  : string
Get doc part.
getDocPartId()  : int
Get doc part Id.
getElementId()  : string
Get element unique ID.
getElementIndex()  : int
Get element index.
getEntries()  : array<string|int, mixed>
Get entries.
getFontStyle()  : Font|string
Get Text style.
getName()  : string|null
Get name.
getNestedLevel()  : int
Get nested level.
getParagraphStyle()  : Paragraph|string
Get Paragraph style.
getParent()  : null|AbstractElement
Get parent element.
getPhpWord()  : PhpWord|null
Get PhpWord.
getRelationId()  : int
Get relation Id.
getSectionId()  : int
Get section number.
getText()  : string|null
Get Text content.
getTrackChange()  : TrackChange
Gets the trackChange information.
getType()  : string
Get type.
getValue()  : null|bool|int|string
Get value.
isInSection()  : bool
Check if element is located in Section doc part (as opposed to Header/Footer).
setChangeInfo()  : void
Set changed.
setCommentRangeEnd()  : void
Set comment end.
setCommentRangeStart()  : void
Set comment start.
setDefault()  : self
Set default.
setDocPart()  : void
Set doc part.
setElementId()  : void
Set element unique ID from 6 first digit of md5.
setElementIndex()  : void
Set element index.
setEntries()  : self
Set entries.
setFontStyle()  : Font|string
Set Text style.
setName()  : self
Set name.
setParagraphStyle()  : Paragraph|string
Set Paragraph style.
setParentContainer()  : void
Set parent container.
setPhpWord()  : void
Set PhpWord as reference.
setRelationId()  : void
Set relation Id.
setText()  : self
Set text content.
setTrackChange()  : void
Sets the trackChange information.
setType()  : self
Set type.
setValue()  : self
Set value.
setEnumVal()  : null|string
Set enum value.
setNewStyle()  : mixed
Set new style value.
getMediaPart()  : string
Return media element (image, object, link) container name.
setCollectionRelation()  : void
Set relation Id for elements that will be registered in the Collection subnamespaces.
setMediaRelation()  : void
Set relation Id for media elements (link, image, object; legacy of OOXML).

Properties

$collectionRelation

Is part of collection; true for Title, Footnote, Endnote, Chart, and Comment.

protected bool $collectionRelation = false

$docPart

Document part type: Section|Header|Footer|Footnote|Endnote.

protected string $docPart = 'Section'

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.

$docPartId

Document part Id.

protected int $docPartId = 1

For header and footer, this will be = ($sectionId - 1) * 3 + $index because the max number of header/footer in every page is 3, i.e. AUTO, FIRST, and EVEN (AUTO = ODD)

$elementIndex

Index of element in the elements collection (start with 1).

protected int $elementIndex = 1

$fontStyle

Text style.

protected Font|string $fontStyle

$mediaRelation

Has media relation flag; true for Link, Image, and Object.

protected bool $mediaRelation = false

$paragraphStyle

Paragraph style.

protected Paragraph|string $paragraphStyle

$text

Text content.

protected string|null $text

$default

Default value.

private bool|int|string $default
  • TextInput: string
  • CheckBox: bool
  • DropDown: int Index of entries (zero based)

$entries

Dropdown entries.

private array<string|int, mixed> $entries = []

$name

Form field name.

private string|null $name

$nestedLevel

Depth of table container nested level; Primarily used for RTF writer/reader.

private int $nestedLevel = 0

0 = Not in a table; 1 = in a table; 2 = in a table inside another table, etc.

$parentContainer

Parent container type.

private string $parentContainer

$type

Form field type: textinput|checkbox|dropdown.

private string $type = 'textinput'

$value

Value.

private null|bool|int|string $value

Methods

__construct()

Create new instance.

public __construct(string $type[, mixed $fontStyle = null ][, mixed $paragraphStyle = null ]) : mixed
Parameters
$type : string
$fontStyle : mixed = null
$paragraphStyle : mixed = null

getDefault()

Get default.

public getDefault() : bool|int|string
Return values
bool|int|string

getDocPart()

Get doc part.

public getDocPart() : string
Return values
string

getDocPartId()

Get doc part Id.

public getDocPartId() : int
Return values
int

getElementId()

Get element unique ID.

public getElementId() : string
Return values
string

getElementIndex()

Get element index.

public getElementIndex() : int
Return values
int

getEntries()

Get entries.

public getEntries() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFontStyle()

Get Text style.

public getFontStyle() : Font|string
Return values
Font|string

getName()

Get name.

public getName() : string|null
Return values
string|null

getNestedLevel()

Get nested level.

public getNestedLevel() : int
Return values
int

getParagraphStyle()

Get Paragraph style.

public getParagraphStyle() : Paragraph|string
Return values
Paragraph|string

getRelationId()

Get relation Id.

public getRelationId() : int
Return values
int

getSectionId()

Get section number.

public getSectionId() : int
Return values
int

getText()

Get Text content.

public getText() : string|null
Return values
string|null

getType()

Get type.

public getType() : string
Return values
string

getValue()

Get value.

public getValue() : null|bool|int|string
Return values
null|bool|int|string

isInSection()

Check if element is located in Section doc part (as opposed to Header/Footer).

public isInSection() : bool
Return values
bool

setChangeInfo()

Set changed.

public setChangeInfo(string $type, string $author[, null|DateTime|int $date = null ]) : void
Parameters
$type : string

INSERTED|DELETED

$author : string
$date : null|DateTime|int = null

allways in UTC

setDefault()

Set default.

public setDefault(bool|int|string $value) : self
Parameters
$value : bool|int|string
Return values
self

setDocPart()

Set doc part.

public setDocPart(string $docPart[, int $docPartId = 1 ]) : void
Parameters
$docPart : string
$docPartId : int = 1

setElementId()

Set element unique ID from 6 first digit of md5.

public setElementId() : void

setElementIndex()

Set element index.

public setElementIndex(int $value) : void
Parameters
$value : int

setEntries()

Set entries.

public setEntries(array<string|int, mixed> $value) : self
Parameters
$value : array<string|int, mixed>
Return values
self

setFontStyle()

Set Text style.

public setFontStyle([array<string|int, mixed>|Font|string $style = null ][, array<string|int, mixed>|Paragraph|string $paragraphStyle = null ]) : Font|string
Parameters
$style : array<string|int, mixed>|Font|string = null
$paragraphStyle : array<string|int, mixed>|Paragraph|string = null
Return values
Font|string

setName()

Set name.

public setName(string|null $value) : self
Parameters
$value : string|null
Return values
self

setParagraphStyle()

Set Paragraph style.

public setParagraphStyle([array<string|int, mixed>|Paragraph|string $style = null ]) : Paragraph|string
Parameters
$style : array<string|int, mixed>|Paragraph|string = null
Return values
Paragraph|string

setParentContainer()

Set parent container.

public setParentContainer(self $container) : void

Passed parameter should be a container, except for Table (contain Row) and Row (contain Cell)

Parameters
$container : self

setPhpWord()

Set PhpWord as reference.

public setPhpWord([PhpWord|null $phpWord = null ]) : void
Parameters
$phpWord : PhpWord|null = null

setRelationId()

Set relation Id.

public setRelationId(int $value) : void
Parameters
$value : int

setText()

Set text content.

public setText(string $text) : self
Parameters
$text : string
Return values
self

setType()

Set type.

public setType(string $value) : self
Parameters
$value : string
Return values
self

setValue()

Set value.

public setValue(null|bool|int|string $value) : self
Parameters
$value : null|bool|int|string
Return values
self

setEnumVal()

Set enum value.

protected setEnumVal([null|string $value = null ][, array<string|int, string> $enum = [] ][, null|string $default = null ]) : null|string
Parameters
$value : null|string = null
$enum : array<string|int, string> = []
$default : null|string = null
Tags
todo

Merge with the same method in AbstractStyle

Return values
null|string

setNewStyle()

Set new style value.

protected setNewStyle(mixed $styleObject[, null|array<string|int, mixed>|string|Style $styleValue = null ][, bool $returnObject = false ]) : mixed
Parameters
$styleObject : mixed

Style object

$styleValue : null|array<string|int, mixed>|string|Style = null

Style value

$returnObject : bool = false

Always return object

getMediaPart()

Return media element (image, object, link) container name.

private getMediaPart() : string
Return values
string

section|headerx|footerx|footnote|endnote

setCollectionRelation()

Set relation Id for elements that will be registered in the Collection subnamespaces.

private setCollectionRelation() : void

setMediaRelation()

Set relation Id for media elements (link, image, object; legacy of OOXML).

private setMediaRelation() : void
  • Image element needs to be passed to Media object
  • Icon needs to be set for Object element

        
On this page

Search results