Class jForms

Description

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.

Located in /forms/jForms.class.php (line 25)


	
			
Class Constant Summary
 ID_PARAM = '__forms_id__'
Method Summary
static jFormBase create (string $formSel, [string $formId = null])
static void destroy (string $formSel, [string $formId = null])
static jFormBase fill (string $formSel, [string $formId = null])
static jFormBase get (string $formSel, [string $formId = null])
Methods
static create (line 47)

Create a new form with empty data

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.

  • return: the object representing the form
  • access: public
static jFormBase create (string $formSel, [string $formId = null])
  • string $formSel: the selector of the xml jform file
  • string $formId: the id of the new instance (an id of a record for example)
static destroy (line 117)

destroy a form in the session

use it after saving data of a form, and if you don't want to re-display the form.

  • access: public
static void destroy (string $formSel, [string $formId = null])
  • string $formSel: the selector of the xml jform file
  • string $formId: the id of the form (if you use multiple instance of a form)
static fill (line 102)

get an existing instance of a form, and fill it with data provided by the request

use it in the action called to submit a webform.

  • return: the object representing the form. Return null if there isn't an existing form
  • access: public
static jFormBase fill (string $formSel, [string $formId = null])
  • string $formSel: the selector of the xml jform file
  • string $formId: the id of the form (if you use multiple instance of a form)
static get (line 72)

get an existing instance of a form

In your controller, call it before to re-display a form with existing data.

  • return: the object representing the form. Return null if there isn't an existing form
  • access: public
static jFormBase get (string $formSel, [string $formId = null])
  • string $formSel: the selector of the xml jform file
  • string $formId: the id of the form (if you use multiple instance of a form)
Class Constants
DEFAULT_ID = 0 (line 29)
ERRDATA_INVALID = 1 (line 31)
ERRDATA_REQUIRED = 2 (line 32)
ID_PARAM = '__forms_id__' (line 27)

Documentation generated on Wed, 07 Sep 2011 13:47:20 +0200 by phpDocumentor 1.4.3