Fieldset
extends Child
in package
implements
ArrayAccess, Countable, IteratorAggregate
Form fieldset class
Tags
Table of Contents
Interfaces
- ArrayAccess
- Countable
- IteratorAggregate
Properties
- $attributes : array<string|int, mixed>
- Child element attributes
- $cData : bool
- Child element node value CDATA flag
- $childNodes : array<string|int, mixed>
- Object child nodes
- $childrenFirst : bool
- Flag to render children before node value or not
- $container : string
- Fieldset container (dl, table, div or p)
- $current : int
- Current field group
- $fields : array<string|int, mixed>
- Form field elements
- $indent : string|null
- Indentation for formatting purposes
- $legend : string|null
- Fieldset legend
- $nodeName : string|null
- Child element node name
- $nodeValue : string|null
- Child element node value
- $output : string|null
- Child output
- $parent : AbstractNode|null
- Parent node
- $preserveWhiteSpace : bool
- Flag to preserve whitespace
Methods
- __construct() : mixed
- Constructor
- __get() : mixed
- Get method to return the value of fields[$name]
- __isset() : bool
- Return the isset value of fields[$name]
- __set() : void
- Set method to set the property to the value of fields[$name]
- __toString() : string
- Render Dom child object to string
- __unset() : void
- Unset fields[$name]
- addChild() : AbstractNode
- Add a child to the object
- addChildren() : AbstractNode
- Add children to the object
- addField() : Fieldset
- Method to add a form field
- addFields() : Fieldset
- Method to add form fields
- addNodeValue() : Child
- Add to the child node value
- count() : int
- Method to get the count of elements in the form fieldset
- create() : Child
- Static factory method to create a child object
- createFromConfig() : Fieldset
- Method to create form fieldset object and fields from config
- createGroup() : Fieldset
- Method to create new group
- getAllFields() : array<string|int, mixed>
- Method to get all field elements
- getAttribute() : string|null
- Get the attribute of the child object
- getAttributes() : array<string|int, mixed>
- Get the attributes of the child object
- getChild() : Child|null
- Get the child nodes of the object
- getChildNodes() : array<string|int, mixed>
- Get the child nodes of the object (alias)
- getChildren() : array<string|int, mixed>
- Get the child nodes of the object
- getContainer() : string
- Method to get container
- getCurrent() : int
- Method to get current group index
- getField() : AbstractElement
- Method to get a field element object
- getFieldGroups() : array<string|int, mixed>
- Method to get all field element groups
- getFields() : array<string|int, mixed>|null
- Method to get field element objects in a group
- getFieldValue() : mixed
- Method to get a field element value
- getIndent() : string
- Return the indent
- getIterator() : ArrayIterator
- Method to iterate over the form elements
- getLegend() : string|null
- Method to get fieldset legend
- getNodeContent() : string
- Return the child node content, including tags, etc
- getNodeName() : string|null
- Return the child node name
- getNodeValue() : string|null
- Return the child node value
- getParent() : AbstractNode|null
- Return the parent node
- getTextContent() : string
- Return the child node content, including tags, etc
- hasAttribute() : bool
- Determine if the child object has an attribute
- hasAttributes() : bool
- Determine if the child object has attributes
- hasChildNodes() : bool
- Get whether or not the child object has children (alias)
- hasChildren() : bool
- Get whether or not the child object has children
- hasField() : bool
- Method to determine if the fieldset has a field
- insertFieldAfter() : Fieldset
- Method to insert a field after another one
- insertFieldBefore() : Fieldset
- Method to insert a field before another one
- isCData() : bool
- Determine if the child node value is CDATA
- isChildrenFirst() : bool
- Determine if child nodes render first, before the node value
- offsetExists() : bool
- ArrayAccess offsetExists
- offsetGet() : mixed
- ArrayAccess offsetGet
- offsetSet() : void
- ArrayAccess offsetSet
- offsetUnset() : void
- ArrayAccess offsetUnset
- parseFile() : Child
- Static method to parse an XML/HTML string from a file
- parseString() : Child|array<string|int, mixed>
- Static method to parse an XML/HTML string
- prepare() : Fieldset
- Prepare fieldset object for rendering
- prepareForView() : array<string|int, mixed>
- Prepare fieldset elements for rendering with a view
- preserveWhiteSpace() : Child
- Set whether to preserve whitespace
- removeAttribute() : Child
- Remove an attribute from the child element object
- removeChild() : void
- Remove all child nodes from the object
- removeChildren() : void
- Remove all child nodes from the object
- render() : string|null
- Render the child and its child nodes.
- setAsCData() : Child
- Set the child node value as CDATA
- setAttribute() : Child
- Set an attribute for the child element object
- setAttributes() : Child
- Set an attribute or attributes for the child element object
- setChildrenFirst() : Child
- Set whether child nodes render first, before the node value
- setContainer() : Fieldset
- Method to set container
- setCurrent() : Fieldset
- Method to get current group index
- setFieldValue() : Fieldset
- Method to set a field element value
- setFieldValues() : Fieldset
- Method to set field element values
- setIndent() : AbstractNode
- Set the indent
- setLegend() : Fieldset
- Method to set fieldset legend
- setNodeName() : Child
- Set the child node name
- setNodeValue() : Child
- Set the child node value
- setParent() : AbstractNode
- Set the parent node
- toArray() : array<string|int, mixed>
- Method to get the field values as an array
- prepareDl() : void
- Prepare DL
- prepareElement() : void
- Prepare DIV or P
- prepareTable() : void
- Prepare table
Properties
$attributes
Child element attributes
protected
array<string|int, mixed>
$attributes
= []
$cData
Child element node value CDATA flag
protected
bool
$cData
= false
$childNodes
Object child nodes
protected
array<string|int, mixed>
$childNodes
= []
$childrenFirst
Flag to render children before node value or not
protected
bool
$childrenFirst
= false
$container
Fieldset container (dl, table, div or p)
protected
string
$container
= 'dl'
$current
Current field group
protected
int
$current
= 0
$fields
Form field elements
protected
array<string|int, mixed>
$fields
= []
$indent
Indentation for formatting purposes
protected
string|null
$indent
= null
$legend
Fieldset legend
protected
string|null
$legend
= null
$nodeName
Child element node name
protected
string|null
$nodeName
= null
$nodeValue
Child element node value
protected
string|null
$nodeValue
= null
$output
Child output
protected
string|null
$output
= null
$parent
Parent node
protected
AbstractNode|null
$parent
= null
$preserveWhiteSpace
Flag to preserve whitespace
protected
bool
$preserveWhiteSpace
= true
Methods
__construct()
Constructor
public
__construct([array<string|int, mixed>|null $fields = null ][, string|null $container = 'dl' ]) : mixed
Instantiate the form fieldset object
Parameters
- $fields : array<string|int, mixed>|null = null
- $container : string|null = 'dl'
__get()
Get method to return the value of fields[$name]
public
__get(string $name) : mixed
Parameters
- $name : string
__isset()
Return the isset value of fields[$name]
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
bool__set()
Set method to set the property to the value of fields[$name]
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
__toString()
Render Dom child object to string
public
__toString() : string
Return values
string__unset()
Unset fields[$name]
public
__unset(string $name) : void
Parameters
- $name : string
addChild()
Add a child to the object
public
addChild(Child $c) : AbstractNode
Parameters
- $c : Child
Tags
Return values
AbstractNodeaddChildren()
Add children to the object
public
addChildren(mixed $children) : AbstractNode
Parameters
- $children : mixed
Tags
Return values
AbstractNodeaddField()
Method to add a form field
public
addField(AbstractElement $field) : Fieldset
Parameters
- $field : AbstractElement
Return values
FieldsetaddFields()
Method to add form fields
public
addFields(array<string|int, mixed> $fields) : Fieldset
Parameters
- $fields : array<string|int, mixed>
Return values
FieldsetaddNodeValue()
Add to the child node value
public
addNodeValue(string $value) : Child
Parameters
- $value : string
Return values
Childcount()
Method to get the count of elements in the form fieldset
public
count() : int
Return values
intcreate()
Static factory method to create a child object
public
static create(string $name[, string|null $value = null ][, array<string|int, mixed> $options = [] ]) : Child
Parameters
- $name : string
- $value : string|null = null
- $options : array<string|int, mixed> = []
Return values
ChildcreateFromConfig()
Method to create form fieldset object and fields from config
public
static createFromConfig(array<string|int, mixed> $config) : Fieldset
Parameters
- $config : array<string|int, mixed>
Return values
FieldsetcreateGroup()
Method to create new group
public
createGroup() : Fieldset
Return values
FieldsetgetAllFields()
Method to get all field elements
public
getAllFields() : array<string|int, mixed>
Return values
array<string|int, mixed>getAttribute()
Get the attribute of the child object
public
getAttribute(string $name) : string|null
Parameters
- $name : string
Return values
string|nullgetAttributes()
Get the attributes of the child object
public
getAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getChild()
Get the child nodes of the object
public
getChild(int $i) : Child|null
Parameters
- $i : int
Return values
Child|nullgetChildNodes()
Get the child nodes of the object (alias)
public
getChildNodes() : array<string|int, mixed>
Return values
array<string|int, mixed>getChildren()
Get the child nodes of the object
public
getChildren() : array<string|int, mixed>
Return values
array<string|int, mixed>getContainer()
Method to get container
public
getContainer() : string
Return values
stringgetCurrent()
Method to get current group index
public
getCurrent() : int
Return values
intgetField()
Method to get a field element object
public
getField(string $name) : AbstractElement
Parameters
- $name : string
Return values
AbstractElementgetFieldGroups()
Method to get all field element groups
public
getFieldGroups() : array<string|int, mixed>
Return values
array<string|int, mixed>getFields()
Method to get field element objects in a group
public
getFields(int $i) : array<string|int, mixed>|null
Parameters
- $i : int
Return values
array<string|int, mixed>|nullgetFieldValue()
Method to get a field element value
public
getFieldValue(string $name) : mixed
Parameters
- $name : string
getIndent()
Return the indent
public
getIndent() : string
Return values
stringgetIterator()
Method to iterate over the form elements
public
getIterator() : ArrayIterator
Return values
ArrayIteratorgetLegend()
Method to get fieldset legend
public
getLegend() : string|null
Return values
string|nullgetNodeContent()
Return the child node content, including tags, etc
public
getNodeContent([bool $ignoreWhiteSpace = false ]) : string
Parameters
- $ignoreWhiteSpace : bool = false
Return values
stringgetNodeName()
Return the child node name
public
getNodeName() : string|null
Return values
string|nullgetNodeValue()
Return the child node value
public
getNodeValue() : string|null
Return values
string|nullgetParent()
Return the parent node
public
getParent() : AbstractNode|null
Return values
AbstractNode|nullgetTextContent()
Return the child node content, including tags, etc
public
getTextContent([bool $ignoreWhiteSpace = false ]) : string
Parameters
- $ignoreWhiteSpace : bool = false
Return values
stringhasAttribute()
Determine if the child object has an attribute
public
hasAttribute(string $name) : bool
Parameters
- $name : string
Return values
boolhasAttributes()
Determine if the child object has attributes
public
hasAttributes() : bool
Return values
boolhasChildNodes()
Get whether or not the child object has children (alias)
public
hasChildNodes() : bool
Return values
boolhasChildren()
Get whether or not the child object has children
public
hasChildren() : bool
Return values
boolhasField()
Method to determine if the fieldset has a field
public
hasField(string $name) : bool
Parameters
- $name : string
Return values
boolinsertFieldAfter()
Method to insert a field after another one
public
insertFieldAfter(string $name, AbstractElement $field) : Fieldset
Parameters
- $name : string
- $field : AbstractElement
Return values
FieldsetinsertFieldBefore()
Method to insert a field before another one
public
insertFieldBefore(string $name, AbstractElement $field) : Fieldset
Parameters
- $name : string
- $field : AbstractElement
Return values
FieldsetisCData()
Determine if the child node value is CDATA
public
isCData() : bool
Return values
boolisChildrenFirst()
Determine if child nodes render first, before the node value
public
isChildrenFirst() : bool
Return values
booloffsetExists()
ArrayAccess offsetExists
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
ArrayAccess offsetGet
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
offsetSet()
ArrayAccess offsetSet
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
offsetUnset()
ArrayAccess offsetUnset
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
parseFile()
Static method to parse an XML/HTML string from a file
public
static parseFile(string $file) : Child
Parameters
- $file : string
Tags
Return values
ChildparseString()
Static method to parse an XML/HTML string
public
static parseString(string $string) : Child|array<string|int, mixed>
Parameters
- $string : string
Return values
Child|array<string|int, mixed>prepare()
Prepare fieldset object for rendering
public
prepare() : Fieldset
Return values
FieldsetprepareForView()
Prepare fieldset elements for rendering with a view
public
prepareForView() : array<string|int, mixed>
Return values
array<string|int, mixed>preserveWhiteSpace()
Set whether to preserve whitespace
public
preserveWhiteSpace([bool $preserve = true ]) : Child
Parameters
- $preserve : bool = true
Return values
ChildremoveAttribute()
Remove an attribute from the child element object
public
removeAttribute(string $name) : Child
Parameters
- $name : string
Return values
ChildremoveChild()
Remove all child nodes from the object
public
removeChild(int $i) : void
Parameters
- $i : int
removeChildren()
Remove all child nodes from the object
public
removeChildren() : void
render()
Render the child and its child nodes.
public
render([int $depth = 0 ][, string|null $indent = null ][, bool $inner = false ]) : string|null
Parameters
- $depth : int = 0
- $indent : string|null = null
- $inner : bool = false
Return values
string|nullsetAsCData()
Set the child node value as CDATA
public
setAsCData([bool $cData = true ]) : Child
Parameters
- $cData : bool = true
Return values
ChildsetAttribute()
Set an attribute for the child element object
public
setAttribute(string $name[, mixed $value = null ]) : Child
Parameters
- $name : string
- $value : mixed = null
Return values
ChildsetAttributes()
Set an attribute or attributes for the child element object
public
setAttributes(array<string|int, mixed> $attributes) : Child
Parameters
- $attributes : array<string|int, mixed>
Return values
ChildsetChildrenFirst()
Set whether child nodes render first, before the node value
public
setChildrenFirst([bool $first = true ]) : Child
Parameters
- $first : bool = true
Return values
ChildsetContainer()
Method to set container
public
setContainer(string $container) : Fieldset
Parameters
- $container : string
Return values
FieldsetsetCurrent()
Method to get current group index
public
setCurrent(int $i) : Fieldset
Parameters
- $i : int
Return values
FieldsetsetFieldValue()
Method to set a field element value
public
setFieldValue(string $name, mixed $value) : Fieldset
Parameters
- $name : string
- $value : mixed
Return values
FieldsetsetFieldValues()
Method to set field element values
public
setFieldValues(array<string|int, mixed> $values) : Fieldset
Parameters
- $values : array<string|int, mixed>
Return values
FieldsetsetIndent()
Set the indent
public
setIndent(string $indent) : AbstractNode
Parameters
- $indent : string
Return values
AbstractNodesetLegend()
Method to set fieldset legend
public
setLegend(string $legend) : Fieldset
Parameters
- $legend : string
Return values
FieldsetsetNodeName()
Set the child node name
public
setNodeName(string $name) : Child
Parameters
- $name : string
Return values
ChildsetNodeValue()
Set the child node value
public
setNodeValue(string $value) : Child
Parameters
- $value : string
Return values
ChildsetParent()
Set the parent node
public
setParent(AbstractNode $parent) : AbstractNode
Parameters
- $parent : AbstractNode
Return values
AbstractNodetoArray()
Method to get the field values as an array
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>prepareDl()
Prepare DL
protected
prepareDl() : void
prepareElement()
Prepare DIV or P
protected
prepareElement(string $element) : void
Parameters
- $element : string
prepareTable()
Prepare table
protected
prepareTable() : void