static class to manage and call a form
A form is identified by a selector, and each instance of a form have a unique id (formId). This id can be the id of a record for example. If it is not given, the id is set to 0.
| package |
jelix |
|---|---|
| subpackage |
forms |
__construct()
clean( $formSel = '', integer $life = 86400)
integerthe number of second of a life of a form
create(string $formSel, string $formId = null) : \jFormsBase
Call it to create a new form, before to display it. Data of the form are stored in the php session in a jFormsDataContainer object. If a form with same id exists, data are erased.
stringthe selector of the xml jform file
stringthe id of the new instance (an id of a record for example)
\jFormsBasethe object representing the form
destroy(string $formSel, string $formId = null)
use it after saving data of a form, and if you don't want to re-display the form.
stringthe selector of the xml jform file
stringthe id of the form (if you use multiple instance of a form)
fill(string $formSel, string $formId = null) : \jFormsBase
use it in the action called to submit a webform.
stringthe selector of the xml jform file
stringthe id of the form (if you use multiple instance of a form)
\jFormsBasethe object representing the form. Return null if there isn't an existing form
get(string $formSel, string $formId = null) : \jFormsBase
In your controller, call it before to re-display a form with existing data.
stringthe selector of the xml jform file
stringthe id of the form (if you use multiple instance of a form)
\jFormsBasethe object representing the form. Return null if there isn't an existing form
ID_PARAM
DEFAULT_ID
ERRDATA_INVALID
ERRDATA_REQUIRED
ERRDATA_INVALID_FILE_SIZE
ERRDATA_INVALID_FILE_TYPE
ERRDATA_FILE_UPLOAD_ERROR