Form with basic functionality, from which other form classes derive.

This class provides a basic form. This includes : - showing a form and the included fields.

category Form
package Formaid
author Dieter Adriaenssens
copyright 2006-2013 Dieter Adriaenssens
license GPL
link http://formaid.sourceforge.net/

 Methods

Constructor, initialises an instance of Formaid_Form

__construct(string $table_name, string $file_name, string $return_url, string $database) : void

Parameters

$table_name

string

Table name

$file_name

string

File name of page containing the table

$return_url

string

URL to return to after processing form

$database

string

Database to use

Displays a HTML form.

display(string $mode) : void

Parameters

$mode

string

Mode this function is working in (form, value)

Display record values

displayValues() : void

Execute display() method in "values" mode. In this mode, no form is displayed, but the values of the record are printed on the webpage. The values can't be edited.

Generates HTML for a record form on a web page.

getDisplayString(string $mode) : string

If the mode is form, a form is shown : this includes a title, form tags and form fields (input boxes, ...) If the mode is value, only the values of a record are shown, there is no possibility to change and submit values.

Parameters

$mode

string

Mode this function is working in (form, values)

Returns

string

Custom string that will be appended before automatically generated form

getDisplayStringPrefix(string $mode) : string

Parameters

$mode

string

Mode this function is working in (form, values)

Returns

string

Custom string that will be appended after automatically generated form

getDisplayStringSuffix(string $mode) : string

Parameters

$mode

string

Mode this function is working in (form, values)

Returns

string

Displays a HTML form.

show(string $mode) : void
deprecated use display()

Parameters

$mode

string

Mode this function is working in (form, value)

Display record values

showValues() : void

Execute display() method in "values" mode. In this mode, no form is displayed, but the values of the record are printed on the webpage. The values can't be edited.

deprecated use displayValues()

Checks if displaying the form is allowed.

allowShow() : bool

If the Privilege on this form (allow_show) is set, it is allowed to display the form.

Returns

booltrue if displaying is allowed.

Redirect to a new url

redirectToUrl(string $message) : void

Usually this happens after an insert/modify or delete

Parameters

$message

string

Message for user to pass in the url

 Properties

 

$data : array
access public
 

$filename : string
access public
 

$message : string
access public
 

$privileges : array
access public
 

$return_url : string
access public
 

$sql_table : string
access public
 

$title : string
access public
 

$db_connection : object
access protected
 

$encoding : string
access protected