|
|
File: g:\Work\WWW\php\tbox\lib/cdbtabform.phps
PHP Documentation - PHP/Toolbox::Form
CDBTabForm
CSnippet | +-- CForm | +-- CDBForm | +-- CDBQueryForm | +-- CDBTabForm
Uses "show fields from table" statement
|
private class CDBTabForm extends CDBQueryForm
Uses "show fields from table" statement
to generate a form for given table.
| $form = new CDBQueryForm(FORM_HTML_HANDLER,
| "table_1",
| $PHP_SELF, "get"
| );
| $form->build(array(
| "field_1" => new CControl(array(
| ...
| )),
| ...
| ));
| ...
| $form->render();
|
|
|
|
|
Methods inherited from CForm |
cform, addcontrols, addcontrol, addvars, addsubmitcancel, setmode, getvalue, invalue, outvalue, outvalues, validatevalues, validatevalue, render, renderstart, renderend, rendercontrol, renderstartcontrol, renderendcontrol, write |
|
|
|
|
Fields inherited from CDBQueryForm |
$sql |
|
|
Fields inherited from CSnippet |
$id |
|
|
Public Method Details |
CDBTabForm |
public void CDBTabForm( $handler, string $table, string $action, string $method, string $attrs )
|
|
Constructs the form.
The call format is similar to base class.
|
Parameter |
|
|
$handler |
|
|
No additional comments. |
string |
$table |
|
|
No additional comments. |
string |
$action |
|
|
No additional comments. |
string |
$method |
|
|
No additional comments. |
string |
$attrs |
|
|
No additional comments. |
|
Returns |
void |
|
|
Private Method Details |
build |
private void build( [ array $FIELD_DESCR ] )
|
|
Builds the control list
using the form sql-query meta-info.
No additional comments.
|
Parameter |
|
array |
$FIELD_DESCR |
= >>array()<<
|
|
|
|
Returns |
void |
|
fetchValues |
private void fetchValues( string $where )
|
|
Fetches controls' values from the query.
It performs some std processing, like converting csv-lists into arrays
and uses control's inValue() to possibly customize the value processing as well.
No additional comments.
|
Parameter |
|
string |
$where |
|
|
- fetching use its own where clause that is simply appended to form sql-string:
"$this->sql $this->where $where" |
|
Returns |
void |
See Also |
CDBQueryForm() |
|
setList |
private void setList( string $table )
|
|
Constructs the SQL 'set' clause list with the fields that
belong to specified table, e.g.:
| do_query("insert into table_1 set ".setList("table_1");
No additional comments.
|
Parameter |
|
string |
$table |
|
|
No additional comments. |
|
Returns |
void |
|
|
Private Field Details |
$groupSizeThreshold |
private integer $groupSizeThreshold
>>4 <<
If the group items count exceeds this value
then CSelect is used, otherwise -- CGroup.
|
|
$groupLenThreshold |
private integer $groupLenThreshold
>>40 <<
If summary group items length exceeds this value
then CSelect is used, otherwise -- CGroup.
|
|
$table |
private unknown $table
>> <<
|
|
|
|
|
PHPDoc 1.0beta |