Just like grid, but you can use form tags: input, select, check, etc.
More...
Inherits PCGrid.
|
| __construct ($path='', $sessName='') |
| Constructor - load formgrid template. More...
|
|
| print_Element ($id, $sub, $value) |
| This function is called for each template tag when it is printed. More...
|
|
| insert ($tab) |
| Insert form values into dbtable $tab. More...
|
|
| update ($tab) |
| Update records in database table $tab, using primary key (pk). More...
|
|
|
| $submitted = false |
| This variable is set when formgrid has been submitted, in which case it contains name of pressed button.
|
|
|
| $className = 'gridform' |
| Name of the 'class' element.
|
|
Just like grid, but you can use form tags: input, select, check, etc.
You can submit this and store to database with insert() and update() functions. Each row will be updated using primary key, which must be defined. Use "primary FIELDNAME" in elements. Whole page is updated at once and only one (active) page is submitted. Note that lot of form capabilities are not supported at now. No validation, file uploads etc. This is just alpha-version. See http://pclib.brambor.net/demo/gridform/ for some example.
◆ __construct()
__construct |
( |
|
$path = '' , |
|
|
|
$sessName = '' |
|
) |
| |
Constructor - load formgrid template.
- Parameters
-
string | $tpl_file | Filename of template file |
string | $sessname | When set, object is stored in session as $sessname |
◆ getHttpData()
Return data sent through http.
- Returns
- array $data
◆ insert()
Insert form values into dbtable $tab.
- Parameters
-
string | $tab | database table name |
- See also
- form::insert()
◆ print_Element()
print_Element |
( |
|
$id, |
|
|
|
$sub, |
|
|
|
$value |
|
) |
| |
This function is called for each template tag when it is printed.
- Template element handler
- Get element definition from Tpl->elements and write element value from Tpl->values into template.
- Note
- This function comes in form print_*() where "*" is usually TAGNAME which can be used in <?elements ?> section of template.
- Parameters
-
string | $id | name of template tag {ID} |
string | $sub | modificator (second part) of template tag name {ID.sub} |
mixed | $value | value of element going from Tpl->values array |
◆ print_Primary()
print_Primary |
( |
|
$id, |
|
|
|
$sub, |
|
|
|
$value |
|
) |
| |
|
protected |
Print hidden input field with primary key value.
Used for update.
- Template element handler
- Get element definition from Tpl->elements and write element value from Tpl->values into template.
- Note
- This function comes in form print_*() where "*" is usually TAGNAME which can be used in <?elements ?> section of template.
- Parameters
-
string | $id | name of template tag {ID} |
string | $sub | modificator (second part) of template tag name {ID.sub} |
mixed | $value | value of element going from Tpl->values array |
◆ update()
Update records in database table $tab, using primary key (pk).
- Parameters
-
string | $tab | database table name |
- See also
- form::update()
The documentation for this class was generated from the following file: