Elgg
Version 6.1
|
Stick forms service. More...
Public Member Functions | |
__construct (protected\ElggSession $session) | |
Constructor. More... | |
makeStickyForm (string $form_name, array $ignored_field_names=[]) | |
Save form submission data (all GET and POST vars) into a session cache. More... | |
clearStickyForm (string $form_name) | |
Remove form submission data from the session. More... | |
isStickyForm (string $form_name) | |
Does form submission data exist for this form? More... | |
getStickyValue (string $form_name, string $variable= '', $default=null, bool $filter_result=true) | |
Get a specific value from cached form submission data. More... | |
getStickyValues (string $form_name, bool $filter_result=true) | |
Get all submission data cached for a form. More... | |
Elgg\Forms\StickyForms::__construct | ( | protected\ElggSession | $session | ) |
Constructor.
\ElggSession | $session | Session for storage |
Definition at line 18 of file StickyForms.php.
Elgg\Forms\StickyForms::clearStickyForm | ( | string | $form_name | ) |
Remove form submission data from the session.
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.
string | $form_name | Form namespace |
Definition at line 69 of file StickyForms.php.
Elgg\Forms\StickyForms::getStickyValue | ( | string | $form_name, |
string | $variable = '' , |
||
$default = null , |
|||
bool | $filter_result = true |
||
) |
Get a specific value from cached form submission data.
string | $form_name | The name of the form |
string | $variable | The name of the variable |
mixed | $default | Default value if the variable does not exist in sticky cache |
boolean | $filter_result | Filter for bad input if true |
Definition at line 98 of file StickyForms.php.
Elgg\Forms\StickyForms::getStickyValues | ( | string | $form_name, |
bool | $filter_result = true |
||
) |
Get all submission data cached for a form.
string | $form_name | The name of the form |
bool | $filter_result | Filter for bad input if true |
Definition at line 121 of file StickyForms.php.
Elgg\Forms\StickyForms::isStickyForm | ( | string | $form_name | ) |
Does form submission data exist for this form?
string | $form_name | Form namespace |
Definition at line 83 of file StickyForms.php.
Elgg\Forms\StickyForms::makeStickyForm | ( | string | $form_name, |
array | $ignored_field_names = [] |
||
) |
Save form submission data (all GET and POST vars) into a session cache.
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
string | $form_name | Name of the sticky form |
string[] | $ignored_field_names Field names which shouldn't be made sticky in this form |
Definition at line 32 of file StickyForms.php.