\Pop\Form\Element\InputCsrf

Form CSRF element class

Summary

Methods
Properties
Constants
__construct()
setRequired()
setDisabled()
setReadonly()
setValue()
resetValue()
getValue()
getType()
validate()
setName()
setLabel()
setHint()
setLabelAttribute()
setLabelAttributes()
setHintAttribute()
setHintAttributes()
setErrorPre()
isErrorPre()
setValidators()
clearErrors()
getName()
getLabel()
getHint()
getLabelAttributes()
getHintAttributes()
getValidators()
isRequired()
isDisabled()
isReadonly()
isButton()
getErrors()
hasErrors()
addValidator()
addValidators()
validateValue()
validateCallable()
__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()
createNewToken()
No public properties found
No constants found
setValidator()
$name
$label
$hint
$labelAttributes
$hintAttributes
$required
$disabled
$readonly
$validators
$errorPre
$errors
$nodeName
$nodeValue
$cData
$childrenFirst
$attributes
$preserveWhiteSpace
$childNodes
$indent
$output
$parent
$token
N/A
No private methods found
No private properties found
N/A

Properties

$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

$token

$token : array

Current token data

Type

array

Methods

__construct()

__construct(string  $name, string  $value = null, integer  $expire = 300, string  $indent = null) 

Constructor

Instantiate the CSRF input form element

Parameters

string $name
string $value
integer $expire
string $indent

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

setValue()

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

Set the value of the form element

Parameters

mixed $value

Returns

\Pop\Form\Element\AbstractElement

getValue()

getValue() : mixed

Get form element value

Returns

mixed

getType()

getType() : string

Get form element object type

Returns

string

validate()

validate(array  $formValues = array()) : boolean

Validate the form element object

Parameters

array $formValues

Returns

boolean

setName()

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

Set the name of the form element object

Parameters

string $name

Returns

\Pop\Form\Element\AbstractElement

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

isButton()

isButton() : boolean

Get whether the form element object is a button

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

validateValue()

validateValue(mixed  $value, array  $formValues = array()) : void

Validate the value

Parameters

mixed $value
array $formValues

validateCallable()

validateCallable(callable  $validator, mixed  $value, array  $formValues = array()) : void

Validate the value by callable

Parameters

callable $validator
mixed $value
array $formValues

__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

createNewToken()

createNewToken(string  $value, integer  $expire = 300) : \Pop\Form\Element\Input\Csrf

Set the token of the csrf form element

Parameters

string $value
integer $expire

Returns

\Pop\Form\Element\Input\Csrf

setValidator()

setValidator() : void

Set the validator

Throws

\Pop\Form\Element\Input\Exception