\Pop\Form\ElementSelect

Form select element class

Summary

Methods
Properties
Constants
setRequired()
setDisabled()
setReadonly()
getType()
getValue()
getSelected()
getOptions()
getOptionsAsArray()
validate()
parseValues()
__construct()
setName()
setValue()
resetValue()
setLabel()
setHint()
setLabelAttribute()
setLabelAttributes()
setHintAttribute()
setHintAttributes()
setErrorPre()
isErrorPre()
setValidators()
clearErrors()
getName()
getLabel()
getHint()
getLabelAttributes()
getHintAttributes()
getValidators()
isRequired()
isDisabled()
isReadonly()
getErrors()
hasErrors()
addValidator()
addValidators()
__toString()
create()
parseString()
parseFile()
getNodeName()
getNodeValue()
getNodeContent()
getTextContent()
setNodeName()
setNodeValue()
addNodeValue()
setAsCData()
isCData()
setAttribute()
setAttributes()
hasAttribute()
getAttribute()
getAttributes()
removeAttribute()
isChildrenFirst()
setChildrenFirst()
preserveWhiteSpace()
render()
getIndent()
setIndent()
getParent()
setParent()
addChild()
addChildren()
hasChildren()
hasChildNodes()
getChild()
getChildren()
getChildNodes()
removeChild()
removeChildren()
No public properties found
MONTHS_SHORT
DAYS_OF_MONTH
HOURS_12
HOURS_24
MINUTES
MINUTES_5
MINUTES_10
MINUTES_15
parseXml()
$selected
$name
$label
$hint
$labelAttributes
$hintAttributes
$required
$disabled
$readonly
$validators
$errorPre
$errors
$nodeName
$nodeValue
$cData
$childrenFirst
$attributes
$preserveWhiteSpace
$childNodes
$indent
$output
$parent
N/A
No private methods found
No private properties found
N/A

Constants

MONTHS_SHORT

MONTHS_SHORT

Constant for months, short

DAYS_OF_MONTH

DAYS_OF_MONTH

Constant for days of the month

HOURS_12

HOURS_12

Constant for 12 hours

HOURS_24

HOURS_24

Constant for 24 hours

MINUTES

MINUTES

Constant for 60 minutes (0-59)

MINUTES_5

MINUTES_5

Constant for minutes in increments of 5

MINUTES_10

MINUTES_10

Constant for minutes in increments of 10

MINUTES_15

MINUTES_15

Constant for minutes in increments of 15

Properties

$selected

$selected : mixed

Selected value(s)

Type

mixed

$name

$name : string

Element name

Type

string

$label

$label : string

Form element label

Type

string

$hint

$hint : string

Form element hint

Type

string

$labelAttributes

$labelAttributes : array

Form element label attributes

Type

array

$hintAttributes

$hintAttributes : array

Form element hint attributes

Type

array

$required

$required : boolean

Form element required property

Type

boolean

$disabled

$disabled : boolean

Form element disabled property

Type

boolean

$readonly

$readonly : boolean

Form element readonly property

Type

boolean

$validators

$validators : array

Form element validators

Type

array

$errorPre

$errorPre : boolean

Form element error display position

Type

boolean

$errors

$errors : array

Form element errors

Type

array

$nodeName

$nodeName : string

Child element node name

Type

string

$nodeValue

$nodeValue : string

Child element node value

Type

string

$cData

$cData : boolean

Child element node value CDATA flag

Type

boolean

$childrenFirst

$childrenFirst : boolean

Flag to render children before node value or not

Type

boolean

$attributes

$attributes : array

Child element attributes

Type

array

$preserveWhiteSpace

$preserveWhiteSpace : boolean

Flag to preserve whitespace

Type

boolean

$childNodes

$childNodes : array

Object child nodes

Type

array

$indent

$indent : string

Indentation for formatting purposes

Type

string

$output

$output : string

Child output

Type

string

Methods

setRequired()

setRequired(boolean  $required) : mixed

Set whether the form element is required

Parameters

boolean $required

Returns

mixed

setDisabled()

setDisabled(boolean  $disabled) : mixed

Set whether the form element is disabled

Parameters

boolean $disabled

Returns

mixed

setReadonly()

setReadonly(boolean  $readonly) : mixed

Set whether the form element is readonly

Parameters

boolean $readonly

Returns

mixed

getType()

getType() : string

Get form element object type

Returns

string

getValue()

getValue() : mixed

Get form element value

Returns

mixed

getSelected()

getSelected() : mixed

Get select form element selected value (alias)

Returns

mixed

getOptions()

getOptions() : array

Get select options

Returns

array

getOptionsAsArray()

getOptionsAsArray() : array

Get select options as array

Returns

array

validate()

validate() : boolean

Validate the form element object

Returns

boolean

parseValues()

parseValues(string|array  $values, string  $xmlFile = null) : array

Set the select element as multiple

Parameters

string|array $values
string $xmlFile

Returns

array

__construct()

__construct(string  $name, string|array  $values, string  $selected = null, string  $xmlFile = null, string  $indent = null) 

Constructor

Instantiate the select form element object

Parameters

string $name
string|array $values
string $selected
string $xmlFile
string $indent

setName()

setName(string  $name) : \Pop\Form\Element\AbstractElement

Set the name of the form element object

Parameters

string $name

Returns

\Pop\Form\Element\AbstractElement

setValue()

setValue(mixed  $value) : \Pop\Form\Element\Select

Set the selected value of the select form element

Parameters

mixed $value

Returns

\Pop\Form\Element\Select

resetValue()

resetValue() : \Pop\Form\Element\Select

Reset the value of the form element

Returns

\Pop\Form\Element\Select

setLabel()

setLabel(string  $label) : \Pop\Form\Element\AbstractElement

Set the label of the form element object

Parameters

string $label

Returns

\Pop\Form\Element\AbstractElement

setHint()

setHint(string  $hint) : \Pop\Form\Element\AbstractElement

Set the hint of the form element object

Parameters

string $hint

Returns

\Pop\Form\Element\AbstractElement

setLabelAttribute()

setLabelAttribute(string  $a, string  $v) : \Pop\Form\Element\AbstractElement

Set an attribute of the label of the form element object

Parameters

string $a
string $v

Returns

\Pop\Form\Element\AbstractElement

setLabelAttributes()

setLabelAttributes(array  $attribs) : \Pop\Form\Element\AbstractElement

Set the attributes of the label of the form element object

Parameters

array $attribs

Returns

\Pop\Form\Element\AbstractElement

setHintAttribute()

setHintAttribute(string  $a, string  $v) : \Pop\Form\Element\AbstractElement

Set an attribute of the hint of the form element object

Parameters

string $a
string $v

Returns

\Pop\Form\Element\AbstractElement

setHintAttributes()

setHintAttributes(array  $attribs) : \Pop\Form\Element\AbstractElement

Set the attributes of the hint of the form element object

Parameters

array $attribs

Returns

\Pop\Form\Element\AbstractElement

setErrorPre()

setErrorPre(boolean  $pre) : \Pop\Form\Element\AbstractElement

Set error pre-display

Parameters

boolean $pre

Returns

\Pop\Form\Element\AbstractElement

isErrorPre()

isErrorPre() : boolean

Determine if error to display before the element

Returns

boolean

setValidators()

setValidators(array  $validators = array()) : \Pop\Form\Element\AbstractElement

Set validators

Parameters

array $validators

Returns

\Pop\Form\Element\AbstractElement

getName()

getName() : string

Get form element object name

Returns

string

getLabel()

getLabel() : string

Get form element object label

Returns

string

getHint()

getHint() : string

Get form element object hint

Returns

string

getLabelAttributes()

getLabelAttributes() : array

Get the attributes of the form element object label

Returns

array

getHintAttributes()

getHintAttributes() : array

Get the attributes of the form element object hint

Returns

array

getValidators()

getValidators() : array

Get validators

Returns

array

isRequired()

isRequired() : boolean

Get whether the form element object is required

Returns

boolean

isDisabled()

isDisabled() : boolean

Get whether the form element object is disabled

Returns

boolean

isReadonly()

isReadonly() : boolean

Get whether the form element object is readonly

Returns

boolean

getErrors()

getErrors() : array

Get form element object errors

Returns

array

hasErrors()

hasErrors() : boolean

Get if form element object has errors

Returns

boolean

addValidator()

addValidator(mixed  $validator) : \Pop\Form\Element\AbstractElement

Add a validator the form element

Parameters

mixed $validator

Throws

\Pop\Form\Element\Exception

Returns

\Pop\Form\Element\AbstractElement

addValidators()

addValidators(array  $validators) : \Pop\Form\Element\AbstractElement

Add multiple validators the form element

Parameters

array $validators

Returns

\Pop\Form\Element\AbstractElement

__toString()

__toString() : string

Render Dom child object to string

Returns

string

create()

create(string  $name, string  $value = null, array  $options = array()) : \Pop\Dom\Child

Static factory method to create a child object

Parameters

string $name
string $value
array $options

Returns

\Pop\Dom\Child

parseString()

parseString(string  $string) : \Pop\Dom\Child|array

Static method to parse an XML/HTML string

Parameters

string $string

Returns

\Pop\Dom\Child|array

parseFile()

parseFile(string  $file) : \Pop\Dom\Child

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

Parameters

string $file

Throws

\Pop\Dom\Exception

Returns

\Pop\Dom\Child

getNodeName()

getNodeName() : string

Return the child node name

Returns

string

getNodeValue()

getNodeValue() : string

Return the child node value

Returns

string

getNodeContent()

getNodeContent(boolean  $ignoreWhiteSpace = false) : string

Return the child node content, including tags, etc

Parameters

boolean $ignoreWhiteSpace

Returns

string

getTextContent()

getTextContent(boolean  $ignoreWhiteSpace = false) : string

Return the child node content, including tags, etc

Parameters

boolean $ignoreWhiteSpace

Returns

string

setNodeName()

setNodeName(string  $name) : \Pop\Dom\Child

Set the child node name

Parameters

string $name

Returns

\Pop\Dom\Child

setNodeValue()

setNodeValue(string  $value) : \Pop\Dom\Child

Set the child node value

Parameters

string $value

Returns

\Pop\Dom\Child

addNodeValue()

addNodeValue(string  $value) : \Pop\Dom\Child

Add to the child node value

Parameters

string $value

Returns

\Pop\Dom\Child

setAsCData()

setAsCData(boolean  $cData = true) : \Pop\Dom\Child

Set the child node value as CDATA

Parameters

boolean $cData

Returns

\Pop\Dom\Child

isCData()

isCData() : boolean

Determine if the child node value is CDATA

Returns

boolean

setAttribute()

setAttribute(string  $a, string  $v) : \Pop\Dom\Child

Set an attribute for the child element object

Parameters

string $a
string $v

Returns

\Pop\Dom\Child

setAttributes()

setAttributes(array  $a) : \Pop\Dom\Child

Set an attribute or attributes for the child element object

Parameters

array $a

Returns

\Pop\Dom\Child

hasAttribute()

hasAttribute(string  $name) : boolean

Determine if the child object has an attribute

Parameters

string $name

Returns

boolean

getAttribute()

getAttribute(string  $name) : string

Get the attribute of the child object

Parameters

string $name

Returns

string

getAttributes()

getAttributes() : array

Get the attributes of the child object

Returns

array

removeAttribute()

removeAttribute(string  $a) : \Pop\Dom\Child

Remove an attribute from the child element object

Parameters

string $a

Returns

\Pop\Dom\Child

isChildrenFirst()

isChildrenFirst() : boolean

Determine if child nodes render first, before the node value

Returns

boolean

setChildrenFirst()

setChildrenFirst(boolean  $first = true) : \Pop\Dom\Child

Set whether child nodes render first, before the node value

Parameters

boolean $first

Returns

\Pop\Dom\Child

preserveWhiteSpace()

preserveWhiteSpace(boolean  $preserve = true) : \Pop\Dom\Child

Set whether to preserve whitespace

Parameters

boolean $preserve

Returns

\Pop\Dom\Child

render()

render(integer  $depth, string  $indent = null, boolean  $inner = false) : mixed

Render the child and its child nodes.

Parameters

integer $depth
string $indent
boolean $inner

Returns

mixed

getIndent()

getIndent() : string

Return the indent

Returns

string

setIndent()

setIndent(string  $indent) : mixed

Set the indent

Parameters

string $indent

Returns

mixed

addChild()

addChild(mixed  $c) : mixed

Add a child to the object

Parameters

mixed $c

Throws

\InvalidArgumentException

Returns

mixed

addChildren()

addChildren(  $children) : mixed

Add children to the object

Parameters

$children

Throws

\Pop\Dom\Exception

Returns

mixed

hasChildren()

hasChildren() : boolean

Get whether or not the child object has children

Returns

boolean

hasChildNodes()

hasChildNodes() : boolean

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

Returns

boolean

getChild()

getChild(integer  $i) : \Pop\Dom\Child

Get the child nodes of the object

Parameters

integer $i

Returns

\Pop\Dom\Child

getChildren()

getChildren() : array

Get the child nodes of the object

Returns

array

getChildNodes()

getChildNodes() : array

Get the child nodes of the object (alias)

Returns

array

removeChild()

removeChild(integer  $i) : void

Remove all child nodes from the object

Parameters

integer $i

removeChildren()

removeChildren() : void

Remove all child nodes from the object

parseXml()

parseXml(string  $xmlFile, string  $name) : array

Static method to parse an XML file of options

Parameters

string $xmlFile
string $name

Returns

array