Documentation

CheckboxSet extends AbstractElement
in package

Form checkbox element set 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

Properties

$append  : string|null
Form element append contents
$attributes  : array<string|int, mixed>
Child element attributes
$cData  : bool
Child element node value CDATA flag
$checkboxes  : array<string|int, mixed>
Array of checkbox input elements
$checked  : array<string|int, mixed>
Array of checked values
$childNodes  : array<string|int, mixed>
Object child nodes
$childrenFirst  : bool
Flag to render children before node value or not
$disabled  : bool
Form element disabled property
$errorPre  : bool
Form element error display position
$errors  : array<string|int, mixed>
Form element errors
$hint  : string|null
Form element hint
$hintAttributes  : array<string|int, mixed>
Form element hint attributes
$indent  : string|null
Indentation for formatting purposes
$label  : string|null
Form element label
$labelAttributes  : array<string|int, mixed>
Form element label attributes
$legend  : string|null
Fieldset legend
$name  : string|null
Element name
$nodeName  : string|null
Child element node name
$nodeValue  : string|null
Child element node value
$output  : string|null
Child output
$parent  : AbstractNode|null
Parent node
$prepend  : string|null
Form element prepend contents
$preserveWhiteSpace  : bool
Flag to preserve whitespace
$readonly  : bool
Form element readonly property
$required  : bool
Form element required property
$requiredMessage  : string|null
Form element required message
$validators  : array<string|int, mixed>
Form element validators

Methods

__construct()  : mixed
Constructor
__toString()  : string
Render Dom child object to string
addChild()  : AbstractNode
Add a child to the object
addChildren()  : AbstractNode
Add children to the object
addNodeValue()  : Child
Add to the child node value
addValidator()  : AbstractElement
Add a validator the form element
addValidators()  : AbstractElement
Add multiple validators the form element
clearErrors()  : AbstractElement
Clear errors
create()  : Child
Static factory method to create a child object
getAppend()  : string|null
Get form element object append contents
getAttribute()  : string|null
Get the attribute of the child object
getAttributes()  : array<string|int, mixed>
Get the attributes of the child object
getChecked()  : mixed
Get the checked value
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
getErrors()  : array<string|int, mixed>
Get form element object errors
getHint()  : string|null
Get form element object hint
getHintAttributes()  : array<string|int, mixed>
Get the attributes of the form element object hint
getIndent()  : string
Return the indent
getLabel()  : string|null
Get form element object label
getLabelAttributes()  : array<string|int, mixed>
Get the attributes of the form element object label
getLegend()  : string|null
Method to get fieldset legend
getName()  : string|null
Get form element object name
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
getPrepend()  : string|null
Get form element object prepend contents
getRequiredMessage()  : string|null
Get the form element object required message
getTextContent()  : string
Return the child node content, including tags, etc
getType()  : string
Get form element object type
getValidators()  : array<string|int, mixed>
Get validators
getValue()  : mixed
Get checkbox form element checked value
hasAppend()  : bool
Determine if form element has append content
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
hasErrors()  : bool
Get if form element object has errors
hasHint()  : bool
Determine if form element has a hint
hasHintAttributes()  : bool
Determine if form element has hint attributes
hasLabel()  : bool
Determine if form element has a label
hasLabelAttributes()  : bool
Determine if form element has label attributes
hasPrepend()  : bool
Determine if form element has prepend content
hasRequiredMessage()  : bool
Does the form element object have a required message
hasValidators()  : bool
Determine if form element has validators
isButton()  : bool
Get whether the form element object is a button
isCData()  : bool
Determine if the child node value is CDATA
isChildrenFirst()  : bool
Determine if child nodes render first, before the node value
isDisabled()  : bool
Get whether the form element object is disabled
isErrorPre()  : bool
Determine if error to display before the element
isReadonly()  : bool
Get whether the form element object is readonly
isRequired()  : bool
Get whether the form element object is required
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
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
Render the child and its child nodes
resetValue()  : CheckboxSet
Reset the value of the form element
setAppend()  : AbstractElement
Set the append contents of the form element object
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
setCheckboxAttribute()  : Child
Set an attribute for the input checkbox elements
setCheckboxAttributes()  : Child
Set an attribute or attributes for the input checkbox elements
setChecked()  : CheckboxSet
Set the checked value
setChildrenFirst()  : Child
Set whether child nodes render first, before the node value
setDisabled()  : CheckboxSet
Set whether the form element is disabled
setErrorPre()  : AbstractElement
Set error pre-display
setHint()  : AbstractElement
Set the hint of the form element object
setHintAttribute()  : AbstractElement
Set an attribute of the hint of the form element object
setHintAttributes()  : AbstractElement
Set the attributes of the hint of the form element object
setIndent()  : AbstractNode
Set the indent
setLabel()  : AbstractElement
Set the label of the form element object
setLabelAttribute()  : AbstractElement
Set an attribute of the label of the form element object
setLabelAttributes()  : AbstractElement
Set the attributes of the label of the form element object
setLegend()  : CheckboxSet
Method to set fieldset legend
setName()  : AbstractElement
Set the name of the form element object
setNodeName()  : Child
Set the child node name
setNodeValue()  : Child
Set the child node value
setParent()  : AbstractNode
Set the parent node
setPrepend()  : AbstractElement
Set the prepend contents of the form element object
setReadonly()  : CheckboxSet
Set whether the form element is readonly
setRequired()  : AbstractElement
Set whether the form element is required
setRequiredMessage()  : AbstractElement
Set the form element is required message
setValidators()  : AbstractElement
Set validators
setValue()  : CheckboxSet
Set the checked value of the checkbox form elements
validate()  : bool
Validate the form element object
validateCallable()  : void
Validate the value by callable
validateValue()  : void
Validate the value

Properties

$append

Form element append contents

protected string|null $append = null

$attributes

Child element attributes

protected array<string|int, mixed> $attributes = []

$cData

Child element node value CDATA flag

protected bool $cData = false

$checkboxes

Array of checkbox input elements

protected array<string|int, mixed> $checkboxes = []

$checked

Array of checked values

protected array<string|int, mixed> $checked = []

$childNodes

Object child nodes

protected array<string|int, mixed> $childNodes = []

$childrenFirst

Flag to render children before node value or not

protected bool $childrenFirst = false

$disabled

Form element disabled property

protected bool $disabled = false

$errorPre

Form element error display position

protected bool $errorPre = false

$errors

Form element errors

protected array<string|int, mixed> $errors = []

$hintAttributes

Form element hint attributes

protected array<string|int, mixed> $hintAttributes = []

$indent

Indentation for formatting purposes

protected string|null $indent = null

$labelAttributes

Form element label attributes

protected array<string|int, mixed> $labelAttributes = []

$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

$prepend

Form element prepend contents

protected string|null $prepend = null

$preserveWhiteSpace

Flag to preserve whitespace

protected bool $preserveWhiteSpace = true

$readonly

Form element readonly property

protected bool $readonly = false

$required

Form element required property

protected bool $required = false

$requiredMessage

Form element required message

protected string|null $requiredMessage = null

$validators

Form element validators

protected array<string|int, mixed> $validators = []

Methods

__construct()

Constructor

public __construct(string $name, array<string|int, mixed> $values[, string|array<string|int, mixed>|null $checked = null ][, string|null $indent = null ]) : mixed

Instantiate a fieldset of checkbox input form elements

Parameters
$name : string
$values : array<string|int, mixed>
$checked : string|array<string|int, mixed>|null = null
$indent : string|null = null

__toString()

Render Dom child object to string

public __toString() : string
Return values
string

addNodeValue()

Add to the child node value

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

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

getAppend()

Get form element object append contents

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

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>

getChecked()

Get the checked value

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

getErrors()

Get form element object errors

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

getHint()

Get form element object hint

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

getHintAttributes()

Get the attributes of the form element object hint

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

getIndent()

Return the indent

public getIndent() : string
Return values
string

getLabel()

Get form element object label

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

getLabelAttributes()

Get the attributes of the form element object label

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

getLegend()

Method to get fieldset legend

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

getName()

Get form element object name

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

getPrepend()

Get form element object prepend contents

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

getRequiredMessage()

Get the form element object required message

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

getType()

Get form element object type

public getType() : string
Return values
string

getValidators()

Get validators

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

getValue()

Get checkbox form element checked value

public getValue() : mixed

hasAppend()

Determine if form element has append content

public hasAppend() : bool
Return values
bool

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

hasErrors()

Get if form element object has errors

public hasErrors() : bool
Return values
bool

hasHint()

Determine if form element has a hint

public hasHint() : bool
Return values
bool

hasHintAttributes()

Determine if form element has hint attributes

public hasHintAttributes() : bool
Return values
bool

hasLabel()

Determine if form element has a label

public hasLabel() : bool
Return values
bool

hasLabelAttributes()

Determine if form element has label attributes

public hasLabelAttributes() : bool
Return values
bool

hasPrepend()

Determine if form element has prepend content

public hasPrepend() : bool
Return values
bool

hasRequiredMessage()

Does the form element object have a required message

public hasRequiredMessage() : bool
Return values
bool

hasValidators()

Determine if form element has validators

public hasValidators() : bool
Return values
bool

isButton()

Get whether the form element object is a button

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

isDisabled()

Get whether the form element object is disabled

public isDisabled() : bool
Return values
bool

isErrorPre()

Determine if error to display before the element

public isErrorPre() : bool
Return values
bool

isReadonly()

Get whether the form element object is readonly

public isReadonly() : bool
Return values
bool

isRequired()

Get whether the form element object is required

public isRequired() : bool
Return values
bool

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>

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
Parameters
$depth : int = 0
$indent : string|null = null
$inner : bool = false
Return values
string

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

setCheckboxAttribute()

Set an attribute for the input checkbox elements

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

setCheckboxAttributes()

Set an attribute or attributes for the input checkbox elements

public setCheckboxAttributes(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

setHintAttributes()

Set the attributes of the hint of the form element object

public setHintAttributes(array<string|int, mixed> $attribs) : AbstractElement
Parameters
$attribs : array<string|int, mixed>
Return values
AbstractElement

setLabelAttributes()

Set the attributes of the label of the form element object

public setLabelAttributes(array<string|int, mixed> $attribs) : AbstractElement
Parameters
$attribs : array<string|int, mixed>
Return values
AbstractElement

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

setRequired()

Set whether the form element is required

public setRequired(bool $required[, string|null $requiredMessage = 'This field is required.' ]) : AbstractElement
Parameters
$required : bool
$requiredMessage : string|null = 'This field is required.'
Return values
AbstractElement

validate()

Validate the form element object

public validate([array<string|int, mixed> $formValues = [] ]) : bool
Parameters
$formValues : array<string|int, mixed> = []
Return values
bool

validateCallable()

Validate the value by callable

public validateCallable(callable $validator, mixed $value[, array<string|int, mixed> $formValues = [] ]) : void
Parameters
$validator : callable
$value : mixed
$formValues : array<string|int, mixed> = []

validateValue()

Validate the value

public validateValue(mixed $value[, array<string|int, mixed> $formValues = [] ]) : void
Parameters
$value : mixed
$formValues : array<string|int, mixed> = []

        
On this page

Search results