PHP Class Elgg\Forms\StickyForms

Since: 1.10.0
Datei anzeigen Open project: elgg/elgg

Public Methods

Method Description
clearStickyForm ( string $form_name ) : void Remove form submission data from the session
clearStickyValue ( string $form_name, string $variable ) : void Remove one value of form submission data from the session
getStickyValue ( string $form_name, string $variable = '', mixed $default = null, boolean $filter_result = true ) : mixed Get a specific value from cached form submission data
getStickyValues ( string $form_name, boolean $filter_result = true ) : array Get all submission data cached for a form
isStickyForm ( string $form_name ) : boolean Does form submission data exist for this form?
makeStickyForm ( string $form_name ) : void Save form submission data (all GET and POST vars) into a session cache

Method Details

clearStickyForm() public method

Call this if validation is successful in the action handler or when they sticky values have been used to repopulate the form after a validation error.
public clearStickyForm ( string $form_name ) : void
$form_name string Form namespace
return void

clearStickyValue() public method

Remove one value of form submission data from the session
public clearStickyValue ( string $form_name, string $variable ) : void
$form_name string The name of the form
$variable string The name of the variable to clear
return void

getStickyValue() public method

Get a specific value from cached form submission data
public getStickyValue ( string $form_name, string $variable = '', mixed $default = null, boolean $filter_result = true ) : mixed
$form_name string The name of the form
$variable string The name of the variable
$default mixed Default value if the variable does not exist in sticky cache
$filter_result boolean Filter for bad input if true
return mixed

getStickyValues() public method

Get all submission data cached for a form
public getStickyValues ( string $form_name, boolean $filter_result = true ) : array
$form_name string The name of the form
$filter_result boolean Filter for bad input if true
return array

isStickyForm() public method

Does form submission data exist for this form?
public isStickyForm ( string $form_name ) : boolean
$form_name string Form namespace
return boolean

makeStickyForm() public method

Call this from an action when you want all your submitted variables available if the submission fails validation and is sent back to the form
public makeStickyForm ( string $form_name ) : void
$form_name string Name of the sticky form
return void