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-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

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

version
4.0.0

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

$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

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|null $value = null ][, array<string|int, mixed> $options = [] ]) : Child
Parameters
$name : string
$value : string|null = 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|null
Parameters
$name : string
Return values
string|null

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

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

getFieldValue()

Method to get a field element value

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

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

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

getNodeValue()

Return the child node value

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

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

hasAttributes()

Determine if the child object has attributes

public hasAttributes() : bool
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

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

removeChild()

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|null

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 $name[, mixed $value = null ]) : Child
Parameters
$name : string
$value : mixed = null
Return values
Child

setAttributes()

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
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

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

prepareElement()

Prepare DIV or P

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

prepareTable()

Prepare table

protected prepareTable() : void

        
On this page

Search results