PHP Class Pop\Form\Element

Author: Nick Sagona, III ([email protected])
Inheritance: extends Pop\Dom\Child
Afficher le fichier Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Свойство Type Description
$allowedTypes array Form element allowed types
$errorDisplay array Form element error display format
$errors array Form element errors
$label string Form element label
$labelAttributes array Form element label attributes
$marked string | array Form element marked value(s)
$name string Element name
$required boolean Form element required property
$type string Element type
$validators array Form element validators
$value string | array Form element value(s)

Méthodes publiques

Méthode Description
__construct ( string $type, string $name, string $value = null, string | array $marked = null, string $indent = null ) : Element Constructor
addValidator ( mixed $validator ) : Element Add a validator the form element object.
clearErrors ( ) : Element Clear errors.
getErrors ( ) : array Get form element object errors.
getLabel ( ) : string Get form element object label.
getLabelAttributes ( ) : array Get the attributes of the form element object label.
getMarked ( ) : mixed Get form element object marked values.
getName ( ) : string Get form element object name.
getType ( ) : string Get form element object type.
getValidators ( ) : array Get validators
getValue ( ) : mixed Get form element object value.
hasErrors ( ) : array Get if form element object has errors.
isCaptcha ( ) : boolean Get whether the form element object is a captcha element.
isCheckbox ( ) : boolean Get whether the form element object is a checkbox element.
isCsrf ( ) : boolean Get whether the form element object is a csrf element.
isMultiple ( ) : boolean Get whether the form element object can have multiple input values.
isRadio ( ) : boolean Get whether the form element object is a radio element.
isRequired ( ) : boolean Get whether the form element object is required.
isSelect ( ) : boolean Get whether the form element object is a select element.
isTextarea ( ) : boolean Get whether the form element object is a textarea element.
output ( ) : string Method to render the child and its child nodes.
render ( boolean $ret = false, integer $depth, string $indent = null, string $errorIndent = null ) : string Method to render the child and its child nodes.
setErrorDisplay ( string $container, array $attribs, boolean $pre = false ) : Element Set error display values
setErrorPost ( boolean $post = true ) : Element Set error post-display
setErrorPre ( boolean $pre = true ) : Element Set error pre-display
setLabel ( mixed $label ) : Element Set the label of the form element object.
setLabelAttributes ( array $attribs ) : Element Set the attributes of the label of the form element object.
setMarked ( mixed $marked ) : Element Set the marked value of the form element object.
setName ( string $name ) : Element Set the name of the form element object.
setRequired ( boolean $required ) : Element Set whether the form element object is required.
setValidators ( array $validators = [] ) : Element Set validators
setValue ( mixed $value ) : Element Set the value of the form element object.
validate ( ) : boolean Validate the form element object.

Method Details

__construct() public méthode

Instantiate the form element object
public __construct ( string $type, string $name, string $value = null, string | array $marked = null, string $indent = null ) : Element
$type string
$name string
$value string
$marked string | array
$indent string
Résultat Element

addValidator() public méthode

Add a validator the form element object.
public addValidator ( mixed $validator ) : Element
$validator mixed
Résultat Element

clearErrors() public méthode

Clear errors.
public clearErrors ( ) : Element
Résultat Element

getErrors() public méthode

Get form element object errors.
public getErrors ( ) : array
Résultat array

getLabel() public méthode

Get form element object label.
public getLabel ( ) : string
Résultat string

getLabelAttributes() public méthode

Get the attributes of the form element object label.
public getLabelAttributes ( ) : array
Résultat array

getMarked() public méthode

Get form element object marked values.
public getMarked ( ) : mixed
Résultat mixed

getName() public méthode

Get form element object name.
public getName ( ) : string
Résultat string

getType() public méthode

Get form element object type.
public getType ( ) : string
Résultat string

getValidators() public méthode

Get validators
public getValidators ( ) : array
Résultat array

getValue() public méthode

Get form element object value.
public getValue ( ) : mixed
Résultat mixed

hasErrors() public méthode

Get if form element object has errors.
public hasErrors ( ) : array
Résultat array

isCaptcha() public méthode

Get whether the form element object is a captcha element.
public isCaptcha ( ) : boolean
Résultat boolean

isCheckbox() public méthode

Get whether the form element object is a checkbox element.
public isCheckbox ( ) : boolean
Résultat boolean

isCsrf() public méthode

Get whether the form element object is a csrf element.
public isCsrf ( ) : boolean
Résultat boolean

isMultiple() public méthode

Get whether the form element object can have multiple input values.
public isMultiple ( ) : boolean
Résultat boolean

isRadio() public méthode

Get whether the form element object is a radio element.
public isRadio ( ) : boolean
Résultat boolean

isRequired() public méthode

Get whether the form element object is required.
public isRequired ( ) : boolean
Résultat boolean

isSelect() public méthode

Get whether the form element object is a select element.
public isSelect ( ) : boolean
Résultat boolean

isTextarea() public méthode

Get whether the form element object is a textarea element.
public isTextarea ( ) : boolean
Résultat boolean

output() public méthode

Method to render the child and its child nodes.
public output ( ) : string
Résultat string

render() public méthode

Method to render the child and its child nodes.
public render ( boolean $ret = false, integer $depth, string $indent = null, string $errorIndent = null ) : string
$ret boolean
$depth integer
$indent string
$errorIndent string
Résultat string

setErrorDisplay() public méthode

Set error display values
public setErrorDisplay ( string $container, array $attribs, boolean $pre = false ) : Element
$container string
$attribs array
$pre boolean
Résultat Element

setErrorPost() public méthode

Set error post-display
public setErrorPost ( boolean $post = true ) : Element
$post boolean
Résultat Element

setErrorPre() public méthode

Set error pre-display
public setErrorPre ( boolean $pre = true ) : Element
$pre boolean
Résultat Element

setLabel() public méthode

Set the label of the form element object.
public setLabel ( mixed $label ) : Element
$label mixed
Résultat Element

setLabelAttributes() public méthode

Set the attributes of the label of the form element object.
public setLabelAttributes ( array $attribs ) : Element
$attribs array
Résultat Element

setMarked() public méthode

Set the marked value of the form element object.
public setMarked ( mixed $marked ) : Element
$marked mixed
Résultat Element

setName() public méthode

Set the name of the form element object.
public setName ( string $name ) : Element
$name string
Résultat Element

setRequired() public méthode

Set whether the form element object is required.
public setRequired ( boolean $required ) : Element
$required boolean
Résultat Element

setValidators() public méthode

Set validators
public setValidators ( array $validators = [] ) : Element
$validators array
Résultat Element

setValue() public méthode

Set the value of the form element object.
public setValue ( mixed $value ) : Element
$value mixed
Résultat Element

validate() public méthode

Validate the form element object.
public validate ( ) : boolean
Résultat boolean

Property Details

$allowedTypes protected_oe property

Form element allowed types
protected array $allowedTypes
Résultat array

$errorDisplay protected_oe property

Form element error display format
protected array $errorDisplay
Résultat array

$errors protected_oe property

Form element errors
protected array $errors
Résultat array

$label protected_oe property

Form element label
protected string $label
Résultat string

$labelAttributes protected_oe property

Form element label attributes
protected array $labelAttributes
Résultat array

$marked protected_oe property

Form element marked value(s)
protected string|array $marked
Résultat string | array

$name protected_oe property

Element name
protected string $name
Résultat string

$required protected_oe property

Form element required property
protected bool $required
Résultat boolean

$type protected_oe property

Element type
protected string $type
Résultat string

$validators protected_oe property

Form element validators
protected array $validators
Résultat array

$value protected_oe property

Form element value(s)
protected string|array $value
Résultat string | array