Documentation

FormField extends Text

Form field element

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

Table of Contents

$collectionRelation  : bool
Is part of collection; true for Title, Footnote, Endnote, Chart, and Comment
$commentRangeEnd  : Comment
The end position for the linked comment
$commentRangeStart  : Comment
The start position for the linked comment
$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  : string|Font
Text style
$mediaRelation  : bool
Has media relation flag; true for Link, Image, and Object
$paragraphStyle  : string|Paragraph
Paragraph style
$phpWord  : PhpWord
PhpWord object
$relationId  : int
Relation Id
$sectionId  : int
Section Id
$text  : string
Text content
$default  : string|bool|int
Default value
$entries  : array<string|int, mixed>
Dropdown entries
$name  : string|bool|int
Form field name
$nestedLevel  : int
Depth of table container nested level; Primarily used for RTF writer/reader
$parent  : AbstractElement|null
A reference to the parent
$parentContainer  : string
Parent container type
$trackChange  : TrackChange
changed element info
$type  : string
Form field type: textinput|checkbox|dropdown
$value  : string|bool|int
Value
__construct()  : mixed
Create new instance
getCommentRangeEnd()  : Comment
Get comment end
getCommentRangeStart()  : Comment
Get comment start
getDefault()  : string|bool|int
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()  : string|Font
Get Text style
getName()  : string
Get name
getNestedLevel()  : int
Get nested level
getParagraphStyle()  : string|Paragraph
Get Paragraph style
getParent()  : AbstractElement|null
Get parent element
getPhpWord()  : PhpWord
Get PhpWord
getRelationId()  : int
Get relation Id
getSectionId()  : int
Get section number
getText()  : string
Get Text content
getTrackChange()  : TrackChange
Gets the trackChange information
getType()  : string
Get type
getValue()  : string|bool|int
Get value
isInSection()  : bool
Check if element is located in Section doc part (as opposed to Header/Footer)
setChangeInfo()  : mixed
Set changed
setCommentRangeEnd()  : mixed
Set comment end
setCommentRangeStart()  : mixed
Set comment start
setDefault()  : self
Set default
setDocPart()  : mixed
Set doc part.
setElementId()  : mixed
Set element unique ID from 6 first digit of md5.
setElementIndex()  : mixed
Set element index.
setEntries()  : self
Set entries
setFontStyle()  : string|Font
Set Text style
setName()  : self
Set name
setParagraphStyle()  : string|Paragraph
Set Paragraph style
setParentContainer()  : mixed
Set parent container
setPhpWord()  : mixed
Set PhpWord as reference.
setRelationId()  : mixed
Set relation Id.
setText()  : self
Set text content
setTrackChange()  : mixed
Sets the trackChange information
setType()  : self
Set type
setValue()  : self
Set value
setEnumVal()  : string|null
Set enum value
setNewStyle()  : mixed
Set new style value
getMediaPart()  : string
Return media element (image, object, link) container name
setCollectionRelation()  : mixed
Set relation Id for elements that will be registered in the Collection subnamespaces.
setMediaRelation()  : mixed
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 string|Font $fontStyle

$mediaRelation

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

protected bool $mediaRelation = false

$paragraphStyle

Paragraph style

protected string|Paragraph $paragraphStyle

$text

Text content

protected string $text

$default

Default value

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

$entries

Dropdown entries

private array<string|int, mixed> $entries = array()

$name

Form field name

private string|bool|int $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'

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
Return values
mixed

getDefault()

Get default

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

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() : string|Font
Return values
string|Font

getName()

Get name

public getName() : string
Return values
string

getNestedLevel()

Get nested level

public getNestedLevel() : int
Return values
int

getParagraphStyle()

Get Paragraph style

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

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
Return values
string

getType()

Get type

public getType() : string
Return values
string

getValue()

Get value

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

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|int|DateTime $date = null ]) : mixed
Parameters
$type : string

INSERTED|DELETED

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

allways in UTC

Return values
mixed

setCommentRangeEnd()

Set comment end

public setCommentRangeEnd(Comment $value) : mixed
Parameters
$value : Comment
Return values
mixed

setCommentRangeStart()

Set comment start

public setCommentRangeStart(Comment $value) : mixed
Parameters
$value : Comment
Return values
mixed

setDefault()

Set default

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

setDocPart()

Set doc part.

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

setElementId()

Set element unique ID from 6 first digit of md5.

public setElementId() : mixed
Return values
mixed

setElementIndex()

Set element index.

public setElementIndex(int $value) : mixed
Parameters
$value : int
Return values
mixed

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([string|array<string|int, mixed>|Font $style = null ][, string|array<string|int, mixed>|Paragraph $paragraphStyle = null ]) : string|Font
Parameters
$style : string|array<string|int, mixed>|Font = null
$paragraphStyle : string|array<string|int, mixed>|Paragraph = null
Return values
string|Font

setName()

Set name

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

setParagraphStyle()

Set Paragraph style

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

setParentContainer()

Set parent container

public setParentContainer(AbstractElement $container) : mixed

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

Parameters
$container : AbstractElement
Return values
mixed

setPhpWord()

Set PhpWord as reference.

public setPhpWord([PhpWord $phpWord = null ]) : mixed
Parameters
$phpWord : PhpWord = null
Return values
mixed

setRelationId()

Set relation Id.

public setRelationId(int $value) : mixed
Parameters
$value : int
Return values
mixed

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(string|bool|int $value) : self
Parameters
$value : string|bool|int
Return values
self

setEnumVal()

Set enum value

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

Merge with the same method in AbstractStyle

Return values
string|null

setNewStyle()

Set new style value

protected setNewStyle(mixed $styleObject[, mixed $styleValue = null ][, bool $returnObject = false ]) : mixed
Parameters
$styleObject : mixed

Style object

$styleValue : mixed = null

Style value

$returnObject : bool = false

Always return object

Return values
mixed

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() : mixed
Return values
mixed

setMediaRelation()

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

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

Search results