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

Class: DB_Table_QuickForm

Source Location: /DB_Table-0.17/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 20]
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.16 2004/04/20 15:18:30 pmjones Exp $



[ Top ]


Method Detail

addElements   [line 116]

void addElements( object &$form, array $cols, [string $array_name = 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   $array_name   —  By default, the form will use the names of the columns as the names of the form elements. If you pass $array_name, the column names will become keys in an array named for this parameter.

[ Top ]

addRules   [line 424]

void addRules( object &$form, array $cols, [string $array_name = 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   $array_name   —  By default, the form will use the names of the columns as the names of the form elements. If you pass $array_name, the column names will become keys in an array named for this parameter.

[ Top ]

fixColDef   [line 486]

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

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

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

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   $array_name   —  By default, the form will use the names of the columns as the names of the form elements. If you pass $array_name, 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


[ Top ]

getGroup   [line 381]

array &getGroup( array $cols, [string $array_name = 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   $array_name   —  By default, the form will use the names of the columns as the names of the form elements. If you pass $array_name, the column names will become keys in an array named for this parameter.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 10:15:12 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.