DB_Table
[ class tree: DB_Table ] [ index: DB_Table ] [ all elements ]

Class: DB_Table_QuickForm

Source Location: /DB_Table-0.21.2/DB/Table/QuickForm.php

Class Overview


DB_Table_QuickForm creates HTML_QuickForm objects from DB_Table properties.


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 33]
DB_Table_QuickForm creates HTML_QuickForm objects from DB_Table properties.

DB_Table_QuickForm provides HTML form creation facilities based on DB_Table column definitions transformed into HTML_QuickForm elements.

$Id: QuickForm.php,v 1.11 2004/07/12 15:14:22 pmjones Exp $



[ Top ]


Method Detail

addElements   [line 135]

void addElements( object &$form, array $cols, [string $arrayName = null])

Adds DB_Table columns to a pre-existing HTML_QuickForm object.
  • Access: public

Parameters:

object   &$form   —  An HTML_QuickForm object.
array   $cols   —  A sequential array of DB_Table column definitions from which to create form elements.
string   $arrayName   —  By default, the form will use the names of the columns as the names of the form elements. If you pass $arrayName, the column names will become keys in an array named for this parameter.

[ Top ]

addRules   [line 450]

void addRules( object &$form, array $cols, [string $arrayName = null], [string $clientValidate = null])

Adds element rules to a pre-existing HTML_QuickForm object.
  • Access: public

Parameters:

object   &$form   —  An HTML_QuickForm object.
array   $cols   —  A sequential array of DB_Table column definitions from which to create form elements.
string   $arrayName   —  By default, the form will use the names of the columns as the names of the form elements. If you pass $arrayName, the column names will become keys in an array named for this parameter.
string   $clientValidate   —  By default, validation will match the 'qf_client' value from the column definition. However, if you set $clientValidate to true or false, this will override the value from the column definition.

[ Top ]

fixColDef   [line 551]

void fixColDef( array &$col, string $elemname)

"Fixes" a DB_Table column definition for QuickForm.

Makes it so that all the 'qf_*' key constants are populated with appropriate default values; also checks the 'require' value (if not set, defaults to false).

  • Access: public

Parameters:

array   &$col   —  A DB_Table column definition.
string   $elemname   —  The name for the target form element.

[ Top ]

getElement   [line 177]

object HTML_QuickForm_Element &getElement( array $col, string $elemname)

Build a single QuickForm element based on a DB_Table column.
  • Access: public

Parameters:

array   $col   —  A DB_Table column definition.
string   $elemname   —  The name to use for the generated QuickForm element.

[ Top ]

getForm   [line 82]

object HTML_QuickForm &getForm( array $cols, [string $arrayName = null], [array $args = array()], [string $clientValidate = null])

Build a form based on DB_Table column definitions.
  • See: HTML_QuickForm
  • Access: public

Parameters:

array   $cols   —  A sequential array of DB_Table column definitions from which to create form elements.
string   $arrayName   —  By default, the form will use the names of the columns as the names of the form elements. If you pass $arrayName, the column names will become keys in an array named for this parameter.
array   $args   — 

An associative array of optional arguments to pass to the QuickForm object. The keys are...

'formName' : String, name of the form; defaults to the name of the table.

'method' : String, form method; defaults to 'post'.

'action' : String, form action; defaults to $_SERVER['REQUEST_URI'].

'target' : String, form target target; defaults to '_self'

'attributes' : Associative array, extra attributes for <form> tag; the key is the attribute name and the value is attribute value.

'trackSubmit' : Boolean, whether to track if the form was submitted by adding a special hidden field

string   $clientValidate   —  By default, validation will match the 'qf_client' value from the column definition. However, if you set $clientValidate to true or false, this will override the value from the column definition.

[ Top ]

getGroup   [line 402]

array &getGroup( array $cols, [string $arrayName = null])

Build an array of form elements based from DB_Table columns.
  • Return: An array of HTML_QuickForm_Element objects.
  • Access: public

Parameters:

array   $cols   —  A sequential array of DB_Table column definitions from which to create form elements.
string   $arrayName   —  By default, the form will use the names of the columns as the names of the form elements. If you pass $arrayName, the column names will become keys in an array named for this parameter.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:52:54 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.