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

Class: DB_Table_QuickForm

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

Class Overview


DB_Table_QuickForm creates HTML_QuickForm objects from DB_Table properties.


Author(s):

Version:

  • Release: 1.5.6

Methods


Inherited Variables

Inherited Methods


Class Details

[line 93]
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.



[ Top ]


Method Detail

addElements   [line 253]

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

Adds DB_Table columns to a pre-existing HTML_QuickForm object.

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 ]

addFilters   [line 813]

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

Adds DB_Table filters 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.
array   $formFilters     An array with filter function names or callbacks that will be applied to all form elements.

[ Top ]

addRules   [line 865]

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 ]

addStaticElements   [line 768]

void addStaticElements( object &$form, array $elements)

Adds static form elements like 'header', 'static', 'submit' or 'reset' to a pre-existing HTML_QuickForm object.
  • Access: public

Parameters:

object   &$form     An HTML_QuickForm object.
array   $elements     A sequential array of form element definitions.

[ Top ]

createForm   [line 197]

object HTML_QuickForm &createForm( [array $args = array()])

Creates an empty form object.

In case you want more control over your form, you can call this function to create it, then add whatever elements you want.


Parameters:

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


[ Top ]

fixColDef   [line 1002]

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 368]

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 ]

getElements   [line 330]

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

Gets controls for a list of columns
  • Return: Form elements
  • Author: Ian Eure <ieure@php.net>
  • 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 ]

getForm   [line 148]

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

Build a form based on DB_Table column definitions.

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.
array   $formFilters     An array with filter function names or callbacks that will be applied to all form elements.

[ Top ]

getGroup   [line 730]

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 Thu, 25 Dec 2008 15:00:31 -0500 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.