PHP 클래스 Pop\Form\Form

저자: Nick Sagona, III ([email protected])
상속: extends Pop\Dom\Dom
파일 보기 프로젝트 열기: nicksagona/PopPHP 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$action string Form action
$errorDisplay array Global Form error display format
$fields array Form field values
$form Pop\Dom\Child Form element node
$groups array Form field groups
$hasFile boolean Has file flag
$initFieldsValues array Form init field values
$method string Form method
$template string Form template for HTML formatting.

공개 메소드들

메소드 설명
__construct ( string $action = null, string $method = 'post', array $fields = null, string $indent = null ) : Form Constructor
__get ( string $name ) : mixed Get method to return the value of fields[$name].
__isset ( string $name ) : boolean Return the isset value of fields[$name].
__set ( string $name, mixed $value ) : void Set method to set the property to the value of fields[$name].
__toString ( ) : string Output the form object as a string
__unset ( string $name ) : void Unset fields[$name].
addElements ( mixed $e ) : Form Add a form element or elements to the form object.
addFields ( array $fields ) : Form Alias for setFields()
clear ( ) : Form Method to clear any session data used with the form for security tokens, captchas, etc.
factory ( string $action = null, string $method = 'post', array $fields = null, string $indent = null ) : Form Static method to instantiate the form object and return itself to facilitate chaining methods together.
filter ( array $filters ) : Form Method to filter current form values with the applied callbacks and their parameters
getAction ( ) : array Get the form action.
getAttributes ( ) : array Get the attributes of the form object.
getElement ( string $elementName ) : Element Get an element object of the form by name.
getElementIndex ( string $elementName ) : integer Get the index of an element object of the form by name.
getElements ( ) : array Get the elements of the form object.
getErrors ( ) : array Get all form element errors.
getField ( $name ) : array Get a single field from $initFieldsValues
getFields ( ) : array Get the form fields
getFormElement ( ) : array Get the main form element.
getMethod ( ) : array Get the form method.
getTemplate ( ) : string Get the form template for the render method to utilize.
hasFile ( ) : boolean Get the $hasFile property
isValid ( ) : boolean Determine whether or not the form object is valid and return the result.
removeElement ( string $elementName ) Remove a form element
render ( boolean $ret = false ) : void Render the form object either using the defined template or by a basic 1:1 DT/DD tag structure.
setAction ( string $action ) : Form Set the form action.
setAttributes ( array | string $a, string $v = null ) : Form Set an attribute or attributes for the form object.
setErrorDisplay ( string $container, array $attribs, boolean $pre = false ) : Form Set error pre-display globally across all form element objects
setField ( string $name, array $field ) : Form Set a single field in $initFieldsValues
setFieldValues ( array $values = null, array $filters = null ) : Form Set the field values. Optionally, you can apply filters to the passed values via callbacks and their parameters
setFields ( array $fields ) : Form Set the fields of the form object.
setMethod ( string $method ) : Form Set the form method.
setTemplate ( string $tmpl ) : Form Set a form template for the render method to utilize.

보호된 메소드들

메소드 설명
filterValues ( array $values, array $filters ) : array Method to filter the values with the applied callbacks and their parameters
renderWithTemplate ( ) : void Method to render the form using the template
renderWithoutTemplate ( ) : void Method to render the form using a basic 1:1 DT/DD layout

메소드 상세

__construct() 공개 메소드

Instantiate the form object
public __construct ( string $action = null, string $method = 'post', array $fields = null, string $indent = null ) : Form
$action string
$method string
$fields array
$indent string
리턴 Form

__get() 공개 메소드

Get method to return the value of fields[$name].
public __get ( string $name ) : mixed
$name string
리턴 mixed

__isset() 공개 메소드

Return the isset value of fields[$name].
public __isset ( string $name ) : boolean
$name string
리턴 boolean

__set() 공개 메소드

Set method to set the property to the value of fields[$name].
public __set ( string $name, mixed $value ) : void
$name string
$value mixed
리턴 void

__toString() 공개 메소드

Output the form object as a string
public __toString ( ) : string
리턴 string

__unset() 공개 메소드

Unset fields[$name].
public __unset ( string $name ) : void
$name string
리턴 void

addElements() 공개 메소드

Add a form element or elements to the form object.
public addElements ( mixed $e ) : Form
$e mixed
리턴 Form

addFields() 공개 메소드

Alias for setFields()
public addFields ( array $fields ) : Form
$fields array
리턴 Form

clear() 공개 메소드

Method to clear any session data used with the form for security tokens, captchas, etc.
public clear ( ) : Form
리턴 Form

factory() 공개 정적인 메소드

Static method to instantiate the form object and return itself to facilitate chaining methods together.
public static factory ( string $action = null, string $method = 'post', array $fields = null, string $indent = null ) : Form
$action string
$method string
$fields array
$indent string
리턴 Form

filter() 공개 메소드

Method to filter current form values with the applied callbacks and their parameters
public filter ( array $filters ) : Form
$filters array
리턴 Form

filterValues() 보호된 메소드

Method to filter the values with the applied callbacks and their parameters
protected filterValues ( array $values, array $filters ) : array
$values array
$filters array
리턴 array

getAction() 공개 메소드

Get the form action.
public getAction ( ) : array
리턴 array

getAttributes() 공개 메소드

Get the attributes of the form object.
public getAttributes ( ) : array
리턴 array

getElement() 공개 메소드

Get an element object of the form by name.
public getElement ( string $elementName ) : Element
$elementName string
리턴 Element

getElementIndex() 공개 메소드

Get the index of an element object of the form by name.
public getElementIndex ( string $elementName ) : integer
$elementName string
리턴 integer

getElements() 공개 메소드

Get the elements of the form object.
public getElements ( ) : array
리턴 array

getErrors() 공개 메소드

Get all form element errors.
public getErrors ( ) : array
리턴 array

getField() 공개 메소드

Get a single field from $initFieldsValues
public getField ( $name ) : array
$name
리턴 array

getFields() 공개 메소드

Get the form fields
public getFields ( ) : array
리턴 array

getFormElement() 공개 메소드

Get the main form element.
public getFormElement ( ) : array
리턴 array

getMethod() 공개 메소드

Get the form method.
public getMethod ( ) : array
리턴 array

getTemplate() 공개 메소드

Get the form template for the render method to utilize.
public getTemplate ( ) : string
리턴 string

hasFile() 공개 메소드

Get the $hasFile property
public hasFile ( ) : boolean
리턴 boolean

isValid() 공개 메소드

Determine whether or not the form object is valid and return the result.
public isValid ( ) : boolean
리턴 boolean

removeElement() 공개 메소드

Remove a form element
public removeElement ( string $elementName )
$elementName string

render() 공개 메소드

Render the form object either using the defined template or by a basic 1:1 DT/DD tag structure.
public render ( boolean $ret = false ) : void
$ret boolean
리턴 void

renderWithTemplate() 보호된 메소드

Method to render the form using the template
protected renderWithTemplate ( ) : void
리턴 void

renderWithoutTemplate() 보호된 메소드

Method to render the form using a basic 1:1 DT/DD layout
protected renderWithoutTemplate ( ) : void
리턴 void

setAction() 공개 메소드

Set the form action.
public setAction ( string $action ) : Form
$action string
리턴 Form

setAttributes() 공개 메소드

Set an attribute or attributes for the form object.
public setAttributes ( array | string $a, string $v = null ) : Form
$a array | string
$v string
리턴 Form

setErrorDisplay() 공개 메소드

Set error pre-display globally across all form element objects
public setErrorDisplay ( string $container, array $attribs, boolean $pre = false ) : Form
$container string
$attribs array
$pre boolean
리턴 Form

setField() 공개 메소드

Set a single field in $initFieldsValues
public setField ( string $name, array $field ) : Form
$name string
$field array
리턴 Form

setFieldValues() 공개 메소드

Set the field values. Optionally, you can apply filters to the passed values via callbacks and their parameters
public setFieldValues ( array $values = null, array $filters = null ) : Form
$values array
$filters array
리턴 Form

setFields() 공개 메소드

Set the fields of the form object.
public setFields ( array $fields ) : Form
$fields array
리턴 Form

setMethod() 공개 메소드

Set the form method.
public setMethod ( string $method ) : Form
$method string
리턴 Form

setTemplate() 공개 메소드

Set a form template for the render method to utilize.
public setTemplate ( string $tmpl ) : Form
$tmpl string
리턴 Form

프로퍼티 상세

$action 보호되어 있는 프로퍼티

Form action
protected string $action
리턴 string

$errorDisplay 보호되어 있는 프로퍼티

Global Form error display format
protected array $errorDisplay
리턴 array

$fields 보호되어 있는 프로퍼티

Form field values
protected array $fields
리턴 array

$form 보호되어 있는 프로퍼티

Form element node
protected Child,Pop\Dom $form
리턴 Pop\Dom\Child

$groups 보호되어 있는 프로퍼티

Form field groups
protected array $groups
리턴 array

$hasFile 보호되어 있는 프로퍼티

Has file flag
protected bool $hasFile
리턴 boolean

$initFieldsValues 보호되어 있는 프로퍼티

Form init field values
protected array $initFieldsValues
리턴 array

$method 보호되어 있는 프로퍼티

Form method
protected string $method
리턴 string

$template 보호되어 있는 프로퍼티

Form template for HTML formatting.
protected string $template
리턴 string