PHP 클래스 Nette\Forms\Form

저자: David Grudl
상속: extends Container
파일 보기 프로젝트 열기: nette/forms 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$httpRequest used only by standalone form
$onError function (Form $sender); Occurs when the form is submitted and is not valid
$onRender function (Form $sender); Occurs before the form is rendered
$onSubmit function (Form $sender); Occurs when the form is submitted
$onSuccess function (Form $sender); Occurs when the form is submitted and successfully validated

공개 메소드들

메소드 설명
__construct ( $name = NULL ) Form constructor.
__toString ( ) : string Renders form to string.
addError ( $message ) : void Adds global error message.
addGroup ( $caption = NULL, $setAsCurrent = TRUE ) : ControlGroup Adds fieldset group to the form.
addProtection ( $message = NULL ) : CsrfProtection Cross-Site Request Forgery (CSRF) form protection.
cleanErrors ( ) : void
fireEvents ( ) : void Fires submit/click events.
fireRenderEvents ( ) : void Must be called before form is rendered and render() is not used.
getAction ( ) : mixed Returns form's action.
getElementPrototype ( ) : Nette\Utils\Html Returns form's HTML element template.
getErrors ( ) : array Returns global validation errors.
getForm ( $need = TRUE ) : self Returns self.
getGroup ( $name ) : ControlGroup Returns the specified group.
getGroups ( ) : ControlGroup[] Returns all defined groups.
getHttpData ( $type = NULL, $htmlName = NULL ) : mixed Returns submitted HTTP data.
getMethod ( ) : string Returns form's method.
getOwnErrors ( ) : array Returns form's validation errors.
getRenderer ( ) : Nette\Forms\IFormRenderer Returns form renderer.
getToggles ( ) : array
getTranslator ( ) : Nette\Localization\ITranslator | null Returns translate adapter.
hasErrors ( ) : boolean
isAnchored ( ) : boolean Tells if the form is anchored.
isMethod ( $method ) : boolean Checks if the request method is the given one.
isSubmitted ( ) : Nette\Forms\ISubmitterControl | FALSE Tells if the form was submitted.
isSuccess ( ) : boolean Tells if the form was submitted and successfully validated.
removeGroup ( $name ) : void Removes fieldset group from form.
render ( $args ) : void Renders form.
setAction ( $url ) : self Sets form's action.
setMethod ( $method ) : self Sets form's method.
setRenderer ( Nette\Forms\IFormRenderer $renderer = NULL ) : self Sets form renderer.
setSubmittedBy ( Nette\Forms\ISubmitterControl $by = NULL ) : self Sets the submittor control.
setTranslator ( Nette\Localization\ITranslator $translator = NULL ) : self Sets translate adapter.
validate ( array $controls = NULL ) ******************* validation ****************d*g*
validateMaxPostSize ( )

보호된 메소드들

메소드 설명
attached ( $obj ) : void This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.
beforeRender ( ) : void
receiveHttpData ( ) : array | null Internal: returns submitted HTTP data or NULL when form was not submitted.
validateParent ( Nette\ComponentModel\IContainer $parent ) : void

비공개 메소드들

메소드 설명
getHttpRequest ( ) : Nette\Http\IRequest

메소드 상세

__construct() 공개 메소드

Form constructor.
public __construct ( $name = NULL )

__toString() 공개 메소드

Renders form to string.
public __toString ( ) : string
리턴 string

addError() 공개 메소드

Adds global error message.
public addError ( $message ) : void
리턴 void

addGroup() 공개 메소드

Adds fieldset group to the form.
public addGroup ( $caption = NULL, $setAsCurrent = TRUE ) : ControlGroup
리턴 ControlGroup

addProtection() 공개 메소드

Cross-Site Request Forgery (CSRF) form protection.
public addProtection ( $message = NULL ) : CsrfProtection
리턴 Nette\Forms\Controls\CsrfProtection

attached() 보호된 메소드

This method will be called when the component (or component's parent) becomes attached to a monitored object. Do not call this method yourself.
protected attached ( $obj ) : void
리턴 void

beforeRender() 보호된 메소드

protected beforeRender ( ) : void
리턴 void

cleanErrors() 공개 메소드

public cleanErrors ( ) : void
리턴 void

fireEvents() 공개 메소드

Fires submit/click events.
public fireEvents ( ) : void
리턴 void

fireRenderEvents() 공개 메소드

Must be called before form is rendered and render() is not used.
public fireRenderEvents ( ) : void
리턴 void

getAction() 공개 메소드

Returns form's action.
public getAction ( ) : mixed
리턴 mixed URI

getElementPrototype() 공개 메소드

Returns form's HTML element template.
public getElementPrototype ( ) : Nette\Utils\Html
리턴 Nette\Utils\Html

getErrors() 공개 메소드

Returns global validation errors.
public getErrors ( ) : array
리턴 array

getForm() 공개 메소드

Returns self.
public getForm ( $need = TRUE ) : self
리턴 self

getGroup() 공개 메소드

Returns the specified group.
public getGroup ( $name ) : ControlGroup
리턴 ControlGroup

getGroups() 공개 메소드

Returns all defined groups.
public getGroups ( ) : ControlGroup[]
리턴 ControlGroup[]

getHttpData() 공개 메소드

Returns submitted HTTP data.
public getHttpData ( $type = NULL, $htmlName = NULL ) : mixed
리턴 mixed

getMethod() 공개 메소드

Returns form's method.
public getMethod ( ) : string
리턴 string get | post

getOwnErrors() 공개 메소드

Returns form's validation errors.
public getOwnErrors ( ) : array
리턴 array

getRenderer() 공개 메소드

Returns form renderer.
public getRenderer ( ) : Nette\Forms\IFormRenderer
리턴 Nette\Forms\IFormRenderer

getToggles() 공개 메소드

public getToggles ( ) : array
리턴 array

getTranslator() 공개 메소드

Returns translate adapter.
public getTranslator ( ) : Nette\Localization\ITranslator | null
리턴 Nette\Localization\ITranslator | null

hasErrors() 공개 메소드

public hasErrors ( ) : boolean
리턴 boolean

isAnchored() 공개 메소드

Tells if the form is anchored.
public isAnchored ( ) : boolean
리턴 boolean

isMethod() 공개 메소드

Checks if the request method is the given one.
public isMethod ( $method ) : boolean
리턴 boolean

isSubmitted() 공개 메소드

Tells if the form was submitted.
public isSubmitted ( ) : Nette\Forms\ISubmitterControl | FALSE
리턴 Nette\Forms\ISubmitterControl | FALSE submittor control

isSuccess() 공개 메소드

Tells if the form was submitted and successfully validated.
public isSuccess ( ) : boolean
리턴 boolean

receiveHttpData() 보호된 메소드

Internal: returns submitted HTTP data or NULL when form was not submitted.
protected receiveHttpData ( ) : array | null
리턴 array | null

removeGroup() 공개 메소드

Removes fieldset group from form.
public removeGroup ( $name ) : void
리턴 void

render() 공개 메소드

Renders form.
public render ( $args ) : void
리턴 void

setAction() 공개 메소드

Sets form's action.
public setAction ( $url ) : self
리턴 self

setMethod() 공개 메소드

Sets form's method.
public setMethod ( $method ) : self
리턴 self

setRenderer() 공개 메소드

Sets form renderer.
public setRenderer ( Nette\Forms\IFormRenderer $renderer = NULL ) : self
$renderer Nette\Forms\IFormRenderer
리턴 self

setSubmittedBy() 공개 메소드

Sets the submittor control.
public setSubmittedBy ( Nette\Forms\ISubmitterControl $by = NULL ) : self
$by Nette\Forms\ISubmitterControl
리턴 self

setTranslator() 공개 메소드

Sets translate adapter.
public setTranslator ( Nette\Localization\ITranslator $translator = NULL ) : self
$translator Nette\Localization\ITranslator
리턴 self

validate() 공개 메소드

******************* validation ****************d*g*
public validate ( array $controls = NULL )
$controls array

validateMaxPostSize() 공개 메소드

public validateMaxPostSize ( )

validateParent() 보호된 메소드

protected validateParent ( Nette\ComponentModel\IContainer $parent ) : void
$parent Nette\ComponentModel\IContainer
리턴 void

프로퍼티 상세

$httpRequest 공개적으로 프로퍼티

used only by standalone form
public $httpRequest

$onError 공개적으로 프로퍼티

function (Form $sender); Occurs when the form is submitted and is not valid
public $onError

$onRender 공개적으로 프로퍼티

function (Form $sender); Occurs before the form is rendered
public $onRender

$onSubmit 공개적으로 프로퍼티

function (Form $sender); Occurs when the form is submitted
public $onSubmit

$onSuccess 공개적으로 프로퍼티

function (Form $sender); Occurs when the form is submitted and successfully validated
public $onSuccess