Constants

SIG

SIG

Properties

$debug

$debug : 

Type

$show

$show : 

Type

$redirect

$redirect : 

Type

$insert_qs

$insert_qs : 

Type

$fields

$fields : 

Type

$messages

$messages : 

Type

$pkey

$pkey : 

Type

$key

$key : 

Type

$table

$table : 

Type

$gflds

$gflds : 

Type

$cflds

$cflds : 

Type

$names

$names : 

Type

$view

$view : 

Type

$signature

$signature : 

Type

$committed

$committed : 

Type

$valid

$valid : 

Type

$newid

$newid : 

Type

$id

$id : 

Type

$idprefix

$idprefix : 

Type

$idprefixlen

$idprefixlen : 

Type

$pksimple

$pksimple : 

Type

$subsfield

$subsfield : 

Type

$subsvalue

$subsvalue : 

Type

$subspostv

$subspostv : 

Type

$subsdshow

$subsdshow : 

Type

$subfn

$subfn : 

Type

$munge

$munge : 

Type

$v

$v : 

Type

$use_un

$use_un : 

Type

Methods

success()

success() : boolean

Wrapper to the $committed variable.

Used to identify whether or not the formlet has committed. Will be true only during a post, when the inputs are all valid, and the commit has occured.

Returns

boolean

setcommit()

setcommit(boolean  $state = true) 

Wrapper to the $committed variable.

Used to set the formlet as if it were committed. This is typically used via a func() operator overload.

Parameters

boolean $state

(optional, defaults to true).

newId()

newId() : integer

Wrapper to the $newid variable.

Provides access to an auto_incremented primary key after a commit.

Returns

integer

valid()

valid() : boolean

Wrapper to the $valid variable.

Indicates if the formlet was found to be valid. When validation is out of scope, a formlet is always valid.

Returns

boolean

getId()

getId() : integer

Wrapper to the $id variable.

Returns the registered id for this formlet. A formlet's id must be unique for the form within which it is placed.

Returns

integer

delete()

delete() 

Simple delete function which may be over-ridden.

This is typically called via a func() 'delete' being implemented.

populate()

populate() 

This is the populate code block of the formlet.

Except for formlets that require no population, it will be over-ridden. This code block is responsible for populating the formlet view with data:

  • after a successful commit
  • during a get, where the form is an editing a record.

func()

func() 

This is the func code block of the formlet.

This code block is responsible for handling submits which are special. Sometimes a formlet may have additional functions (such as 'dependencies','delete', etc). Each button may use the name='_fn' and then value which will be used here. The default value for a button (normal submit) is 'save', which func() does NOT support as the normal formlet processor will handle the 'save' function.

sig()

sig() 

inScope()

inScope() 

'inScope' used to test if a particular class of form is being posted.

isMe()

isMe() 

'isMe' used to test if a particular form instance is being posted.

seterr()

seterr(  $ident = NULL,   $value = NULL) 

'seterr'

Parameters

$ident
$value

setfld()

setfld(  $name = NULL,   $gsql = NULL,   $csql = NULL) 

'setfld'

Parameters

$name
$gsql
$csql

setsub()

setsub(  $name = NULL,   $dshow = true) 

'setsub'

Parameters

$name
$dshow

vset()

vset(  $input = '_unused',   $kind = NULL,   $special = NULL) 

'vset'

Parameters

$input
$kind
$special

formlets()

formlets(  $fms = array(),   $valfn = NULL,   $show = true) 

'formlets' Processes multiple interdependent formlets, preventing invalidity from commits.

All formlets must be processed for a commit. Call reveal() for each fm after this. LIMITATIONS: currently this does not support subscribers (which should be orthogonal) or functions.

Parameters

$fms
$valfn
$show

setfrompost()

setfrompost() 

forminfo()

forminfo() 

form()

form(  $show = true) 

'form'

Parameters

$show

reveal()

reveal() 

setfields()

setfields(  $inpost = false) 

'setfields'

Parameters

$inpost

redirection()

redirection(  $redirect = NULL,   $insert_qs = NULL,   $newid) 

Parameters

$redirect
$insert_qs
$newid

valMacro()

valMacro(  $name = '',   $msg = "Invalid Macrotext") 

validation functions

Parameters

$name
$msg

valEmail()

valEmail(  $name = '',   $msg = "This must be a valid email address") 

Parameters

$name
$msg

valSignificant()

valSignificant(  $name = '',   $msg = "This must have a value") 

Parameters

$name
$msg

valNumeric()

valNumeric(  $name = '',   $msg = " This must be a number.") 

Parameters

$name
$msg

valInt()

valInt(  $name = '',   $msg = " This must be a whole number.") 

Parameters

$name
$msg

valNotZero()

valNotZero(  $name = '',   $msg = " This must be filled correctly.") 

Parameters

$name
$msg

valNoWhitespace()

valNoWhitespace(  $name = '',   $msg = " This must contain no whitespace.") 

Parameters

$name
$msg

valString()

valString(  $name = '',   $msg = "This must be a string") 

Parameters

$name
$msg

valUnique()

valUnique(  $name = '',   $msg = "This must be unique") 

Parameters

$name
$msg

__construct()

__construct(  $key = NULL) 

'__construct'

Parameters

$key

commitv()

commitv() 

'commit-view'

initialise()

initialise(  $use_un = true,   $custom_views = array()) 

Parameters

$use_un
$custom_views

validate()

validate() 

'validate' fn fulfilling abstract requirement of trait 'Form'.

validate all fields in this->fields. errors are placed into the this->view.

iniForm()

iniForm(  $idp = '',   $vp = NULL,   $vprefix = true,   $pk = 'id',   $debug = false) 

'iniForm' To be used in __construct methods.

vprefix = prefix sig to data-tr in form views.

Parameters

$idp
$vp
$vprefix
$pk
$debug

pkeysql()

pkeysql() 

'pkeysql'

vsetopts()

vsetopts(  $input = '_unused',   $qvp = 'select 0 as prompt,0 as value',   $v = NULL) 

'vsetopts'

Parameters

$input
$qvp
$v

subscriber()

subscriber(  $name = NULL,   $orig = NULL) 

'subscriber' This is called only during a post. so we need to find out the current state of the sql.

Parameters

$name
$orig

commit()

commit() 

'commit' fn OVERLOADING trait 'Form'.

ident()

ident() 

setId()

setId(  $id) 

Parameters

$id

setsubsvalue()

setsubsvalue()