PHP 클래스 Horde_Form, horde

The Horde_Form:: package provides form rendering, validation, and other functionality for the Horde Application Framework. Copyright 2001-2007 Robert E. Coyle Copyright 2001-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
저자: Robert E. Coyle ([email protected])
저자: Chuck Hagenbuch ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$_help
$_sections

보호된 프로퍼티들

프로퍼티 타입 설명
$_autofilled
$_currentSection
$_enctype
$_errors
$_extra
$_hiddenVariables
$_name
$_open_section
$_reset
$_submit
$_submitted
$_title
$_useFormToken
$_variables
$_vars

공개 메소드들

메소드 설명
__construct ( $vars, $title = '', $name = null )
_getInfoFromVariables ( array $variables, object &$vars, array &$info ) Fetch the field values from a given array of variables.
_preserveVarByPost ( $varname, $value )
addHidden ( $humanName, $varName, $type, $required, $readonly = false, $description = null, $params = [] ) TODO
addVariable ( $humanName, $varName, $type, $required, $readonly = false, $description = null, $params = [] ) TODO
appendButtons ( $submit )
clearError ( $var )
clearValidation ( )
close ( $renderer )
execute ( )
getError ( $var )
getErrors ( )
getExtra ( )
getInfo ( Variables $vars, array &$info ) Fetch the field values of the submitted form.
getName ( )
getOpenSection ( )
getRenderer ( array $params = [] ) : object Get the renderer for this form, either a custom renderer or the standard one.
getSectionDesc ( $section )
getSectionExpandedState ( $section, $boolean = false )
getSectionImage ( $section )
getTitle ( )
getType ( $type, $params = [] )
getVariables ( $flat = true, $withHidden = false )
getVars ( )
hasHelp ( )
insertVariableBefore ( $before, $humanName, $varName, $type, $required, $readonly = false, $description = null, $params = [] ) TODO
isSubmitted ( ) : boolean Determines if this form has been submitted or not. If the class var _submitted is null then it will check for the presence of the formname in the form variables.
isValid ( )
onSubmit ( Horde_Variables &$vars ) Checks if there is anything to do on the submission of the form by looping through each variable's onSubmit() function.
open ( &$renderer, &$vars, $action, $method = 'get', $enctype = null )
preserve ( $vars )
preserveVarByPost ( &$vars, $varname, $alt_varname = '' )
removeVariable ( Horde_Form_Variable | string &$var ) : boolean Removes a variable from the form.
renderActive ( Horde_Form_Renderer $renderer = null, Variables $vars = null, string $action = '', string $method = 'get', string $enctype = null, boolean $focus = true ) Renders the form for editing.
renderInactive ( Horde_Form_Renderer $renderer = null, Variables $vars = null ) Renders the form for displaying.
setButtons ( $submit, $reset = false )
setError ( $var, $message )
setExtra ( $extra )
setOpenSection ( $section )
setSection ( $section = '', $desc = '', $image = '', $expanded = true )
setSubmitted ( boolean $state = true ) Explicitly sets the state of the form submit.
setTitle ( $title )
setVars ( &$vars )
singleton ( $form, &$vars, $title = '', $name = null )
unsetVars ( &$vars )
useToken ( boolean $token = null ) : boolean Sets or gets whether the form should be verified by tokens.
validate ( Variables $vars = null, $canAutoFill = false ) : boolean Validates the form, checking if it really has been submitted by calling isSubmitted() and if true does any onSubmit() calls for variable types in the form. The _submitted variable is then rechecked.

메소드 상세

__construct() 공개 메소드

public __construct ( $vars, $title = '', $name = null )

_getInfoFromVariables() 공개 메소드

Fetch the field values from a given array of variables.
public _getInfoFromVariables ( array $variables, object &$vars, array &$info )
$variables array An array of Horde_Form_Variable objects to fetch from.
$vars object The Variables object.
$info array The array to be filled with the submitted field values.

_preserveVarByPost() 공개 메소드

public _preserveVarByPost ( $varname, $value )

addHidden() 공개 메소드

TODO
public addHidden ( $humanName, $varName, $type, $required, $readonly = false, $description = null, $params = [] )

addVariable() 공개 메소드

TODO
public addVariable ( $humanName, $varName, $type, $required, $readonly = false, $description = null, $params = [] )

appendButtons() 공개 메소드

public appendButtons ( $submit )

clearError() 공개 메소드

public clearError ( $var )

clearValidation() 공개 메소드

public clearValidation ( )

close() 공개 메소드

public close ( $renderer )

execute() 공개 메소드

public execute ( )

getError() 공개 메소드

public getError ( $var )

getErrors() 공개 메소드

public getErrors ( )

getExtra() 공개 메소드

public getExtra ( )

getInfo() 공개 메소드

Fetch the field values of the submitted form.
public getInfo ( Variables $vars, array &$info )
$vars Variables A Variables instance, optional since Horde 3.2.
$info array Array to be filled with the submitted field values.

getName() 공개 메소드

public getName ( )

getOpenSection() 공개 메소드

public getOpenSection ( )

getRenderer() 공개 메소드

To use a custom form renderer, your form class needs to override this function: function getRenderer() { return new CustomFormRenderer(); } ... where CustomFormRenderer is the classname of the custom renderer class, which should extend Horde_Form_Renderer.
public getRenderer ( array $params = [] ) : object
$params array A hash of renderer-specific parameters.
리턴 object Horde_Form_Renderer The form renderer.

getSectionDesc() 공개 메소드

public getSectionDesc ( $section )

getSectionExpandedState() 공개 메소드

public getSectionExpandedState ( $section, $boolean = false )

getSectionImage() 공개 메소드

public getSectionImage ( $section )

getTitle() 공개 메소드

public getTitle ( )

getType() 공개 메소드

public getType ( $type, $params = [] )

getVariables() 공개 메소드

public getVariables ( $flat = true, $withHidden = false )

getVars() 공개 메소드

public getVars ( )

hasHelp() 공개 메소드

public hasHelp ( )

insertVariableBefore() 공개 메소드

TODO
public insertVariableBefore ( $before, $humanName, $varName, $type, $required, $readonly = false, $description = null, $params = [] )

isSubmitted() 공개 메소드

Other events can explicitly set the _submitted variable to false to indicate a form submit but not for actual posting of data (eg. onChange events to update the display of fields).
public isSubmitted ( ) : boolean
리턴 boolean True or false indicating if the form has been submitted.

isValid() 공개 메소드

public isValid ( )

onSubmit() 공개 메소드

Checks if there is anything to do on the submission of the form by looping through each variable's onSubmit() function.
public onSubmit ( Horde_Variables &$vars )
$vars Horde_Variables

open() 공개 메소드

public open ( &$renderer, &$vars, $action, $method = 'get', $enctype = null )

preserve() 공개 메소드

public preserve ( $vars )

preserveVarByPost() 공개 메소드

public preserveVarByPost ( &$vars, $varname, $alt_varname = '' )

removeVariable() 공개 메소드

As only variables can be passed by reference, you need to call this method this way if want to pass a variable name: $form->removeVariable($var = 'varname');
public removeVariable ( Horde_Form_Variable | string &$var ) : boolean
$var Horde_Form_Variable | string Either the variable's name or the variable to remove from the form.
리턴 boolean True if the variable was found (and deleted).

renderActive() 공개 메소드

Renders the form for editing.
public renderActive ( Horde_Form_Renderer $renderer = null, Variables $vars = null, string $action = '', string $method = 'get', string $enctype = null, boolean $focus = true )
$renderer Horde_Form_Renderer A renderer instance, optional since Horde 3.2.
$vars Variables A Variables instance, optional since Horde 3.2.
$action string The form action (url).
$method string The form method, usually either 'get' or 'post'.
$enctype string The form encoding type. Determined automatically if null.
$focus boolean Focus the first form field?

renderInactive() 공개 메소드

Renders the form for displaying.
public renderInactive ( Horde_Form_Renderer $renderer = null, Variables $vars = null )
$renderer Horde_Form_Renderer A renderer instance, optional since Horde 3.2.
$vars Variables A Variables instance, optional since Horde 3.2.

setButtons() 공개 메소드

public setButtons ( $submit, $reset = false )

setError() 공개 메소드

public setError ( $var, $message )

setExtra() 공개 메소드

public setExtra ( $extra )

setOpenSection() 공개 메소드

public setOpenSection ( $section )

setSection() 공개 메소드

public setSection ( $section = '', $desc = '', $image = '', $expanded = true )

setSubmitted() 공개 메소드

An event can override the automatic determination of the submit state in the isSubmitted() function.
public setSubmitted ( boolean $state = true )
$state boolean Whether to set the state of the form as being submitted.

setTitle() 공개 메소드

public setTitle ( $title )

setVars() 공개 메소드

public setVars ( &$vars )

singleton() 공개 메소드

public singleton ( $form, &$vars, $title = '', $name = null )

unsetVars() 공개 메소드

public unsetVars ( &$vars )

useToken() 공개 메소드

Tokens are used to verify that a form is only submitted once.
public useToken ( boolean $token = null ) : boolean
$token boolean If specified, sets whether to use form tokens.
리턴 boolean Whether form tokens are being used.

validate() 공개 메소드

Validates the form, checking if it really has been submitted by calling isSubmitted() and if true does any onSubmit() calls for variable types in the form. The _submitted variable is then rechecked.
public validate ( Variables $vars = null, $canAutoFill = false ) : boolean
$vars Variables A Variables instance, optional since Horde 3.2.
리턴 boolean True if the form is valid.

프로퍼티 상세

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

protected $_autofilled

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

protected $_currentSection

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

protected $_enctype

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

protected $_errors

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

protected $_extra

$_help 공개적으로 프로퍼티

public $_help

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

protected $_hiddenVariables

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

protected $_name

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

protected $_open_section

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

protected $_reset

$_sections 공개적으로 프로퍼티

public $_sections

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

protected $_submit

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

protected $_submitted

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

protected $_title

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

protected $_useFormToken

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

protected $_variables

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

protected $_vars