Documentation

Fieldset extends Child
in package
implements ArrayAccess, Countable, IteratorAggregate

Form fieldset class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
3.6.0

Interfaces, Classes and Traits

ArrayAccess
Countable
IteratorAggregate

Table of Contents

$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
Indentation for formatting purposes
$legend  : string
Fieldset legend
$nodeName  : string
Child element node name
$nodeValue  : string
Child element node value
$output  : string
Child output
$parent  : AbstractNode
Parent node
$preserveWhiteSpace  : bool
Flag to preserve whitespace
__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()  : mixed
Add a child to the object
addChildren()  : mixed
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
Get the attribute of the child object
getAttributes()  : array<string|int, mixed>
Get the attributes of the child object
getChild()  : Child
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>
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
Method to get fieldset legend
getNodeContent()  : string
Return the child node content, including tags, etc
getNodeName()  : string
Return the child node name
getNodeValue()  : string
Return the child node value
getParent()  : AbstractNode
Return the parent node
getTextContent()  : string
Return the child node content, including tags, etc
hasAttribute()  : bool
Determine if the child object has an attribute
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()  : mixed
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()  : mixed
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 $indent = null

$legend

Fieldset legend

protected string $legend = null

$nodeName

Child element node name

protected string $nodeName = null

$nodeValue

Child element node value

protected string $nodeValue = null

$preserveWhiteSpace

Flag to preserve whitespace

protected bool $preserveWhiteSpace = true

Methods

__construct()

Constructor

public __construct([array<string|int, mixed> $fields = null ][, string $container = 'dl' ]) : mixed

Instantiate the form fieldset object

Parameters
$fields : array<string|int, mixed> = null
$container : string = 'dl'
Return values
mixed

__get()

Get method to return the value of fields[$name]

public __get(string $name) : mixed
Parameters
$name : string
Tags
throws
Exception
Return values
mixed

__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
Return values
void

__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
Return values
void

addChild()

Add a child to the object

public addChild(mixed $c) : mixed
Parameters
$c : mixed
Tags
throws
InvalidArgumentException
Return values
mixed

addChildren()

Add children to the object

public addChildren( $children) : mixed
Parameters
$children :
Tags
throws
Exception
Return values
mixed

addFields()

Method to add form fields

public addFields(array<string|int, mixed> $fields) : Fieldset
Parameters
$fields : array<string|int, mixed>
Return values
Fieldset

addNodeValue()

Add to the child node value

public addNodeValue(string $value) : Child
Parameters
$value : string
Return values
Child

count()

Method to get the count of elements in the form fieldset

public count() : int
Return values
int

create()

Static factory method to create a child object

public static create(string $name[, string $value = null ][, array<string|int, mixed> $options = [] ]) : Child
Parameters
$name : string
$value : string = null
$options : array<string|int, mixed> = []
Return values
Child

createFromConfig()

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
Fieldset

getAllFields()

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
Parameters
$name : string
Return values
string

getAttributes()

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
Parameters
$i : int
Return values
Child

getChildNodes()

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
string

getCurrent()

Method to get current group index

public getCurrent() : int
Return values
int

getFieldGroups()

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>
Parameters
$i : int
Return values
array<string|int, mixed>

getFieldValue()

Method to get a field element value

public getFieldValue(string $name) : mixed
Parameters
$name : string
Return values
mixed

getIndent()

Return the indent

public getIndent() : string
Return values
string

getIterator()

Method to iterate over the form elements

public getIterator() : ArrayIterator
Return values
ArrayIterator

getLegend()

Method to get fieldset legend

public getLegend() : string
Return values
string

getNodeContent()

Return the child node content, including tags, etc

public getNodeContent([bool $ignoreWhiteSpace = false ]) : string
Parameters
$ignoreWhiteSpace : bool = false
Return values
string

getNodeName()

Return the child node name

public getNodeName() : string
Return values
string

getNodeValue()

Return the child node value

public getNodeValue() : string
Return values
string

getTextContent()

Return the child node content, including tags, etc

public getTextContent([bool $ignoreWhiteSpace = false ]) : string
Parameters
$ignoreWhiteSpace : bool = false
Return values
string

hasAttribute()

Determine if the child object has an attribute

public hasAttribute(string $name) : bool
Parameters
$name : string
Return values
bool

hasChildNodes()

Get whether or not the child object has children (alias)

public hasChildNodes() : bool
Return values
bool

hasChildren()

Get whether or not the child object has children

public hasChildren() : bool
Return values
bool

hasField()

Method to determine if the fieldset has a field

public hasField(string $name) : bool
Parameters
$name : string
Return values
bool

isCData()

Determine if the child node value is CDATA

public isCData() : bool
Return values
bool

isChildrenFirst()

Determine if child nodes render first, before the node value

public isChildrenFirst() : bool
Return values
bool

offsetExists()

ArrayAccess offsetExists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

ArrayAccess offsetGet

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed
Return values
mixed

offsetSet()

ArrayAccess offsetSet

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Return values
void

offsetUnset()

ArrayAccess offsetUnset

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed
Return values
void

parseFile()

Static method to parse an XML/HTML string from a file

public static parseFile(string $file) : Child
Parameters
$file : string
Tags
throws
Exception
Return values
Child

parseString()

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>

prepareForView()

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
Child

removeAttribute()

Remove an attribute from the child element object

public removeAttribute(string $a) : Child
Parameters
$a : string
Return values
Child

removeChild()

Remove all child nodes from the object

public removeChild(int $i) : void
Parameters
$i : int
Return values
void

removeChildren()

Remove all child nodes from the object

public removeChildren() : void
Return values
void

render()

Render the child and its child nodes.

public render(int $depth[, string $indent = null ][, bool $inner = false ]) : mixed
Parameters
$depth : int
$indent : string = null
$inner : bool = false
Return values
mixed

setAsCData()

Set the child node value as CDATA

public setAsCData([bool $cData = true ]) : Child
Parameters
$cData : bool = true
Return values
Child

setAttribute()

Set an attribute for the child element object

public setAttribute(string $a, string $v) : Child
Parameters
$a : string
$v : string
Return values
Child

setAttributes()

Set an attribute or attributes for the child element object

public setAttributes(array<string|int, mixed> $a) : Child
Parameters
$a : array<string|int, mixed>
Return values
Child

setChildrenFirst()

Set whether child nodes render first, before the node value

public setChildrenFirst([bool $first = true ]) : Child
Parameters
$first : bool = true
Return values
Child

setContainer()

Method to set container

public setContainer(string $container) : Fieldset
Parameters
$container : string
Return values
Fieldset

setCurrent()

Method to get current group index

public setCurrent(int $i) : Fieldset
Parameters
$i : int
Return values
Fieldset

setFieldValue()

Method to set a field element value

public setFieldValue(string $name, mixed $value) : Fieldset
Parameters
$name : string
$value : mixed
Return values
Fieldset

setFieldValues()

Method to set field element values

public setFieldValues(array<string|int, mixed> $values) : Fieldset
Parameters
$values : array<string|int, mixed>
Return values
Fieldset

setIndent()

Set the indent

public setIndent(string $indent) : mixed
Parameters
$indent : string
Return values
mixed

setLegend()

Method to set fieldset legend

public setLegend(string $legend) : Fieldset
Parameters
$legend : string
Return values
Fieldset

setNodeName()

Set the child node name

public setNodeName(string $name) : Child
Parameters
$name : string
Return values
Child

setNodeValue()

Set the child node value

public setNodeValue(string $value) : Child
Parameters
$value : string
Return values
Child

toArray()

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

prepareElement()

Prepare DIV or P

protected prepareElement(string $element) : void
Parameters
$element : string
Return values
void

prepareTable()

Prepare table

protected prepareTable() : void
Return values
void

Search results