Listing types
You can use the following types
- text
- imageurl
- html
- array
- datetime
- date
Sample Code
// create form object
$forms = new pnFormTrash("people");
// show and list attributes
$forms->listType("comment", "html");
$forms->listType("dateofbirth", "date");
// create html
$forms->doit();
Live Sample
Custom Attribute List Functions
Or you can use your own function to create the layout.
Sample Code
// create form object
$forms = new pnFormTrash("people");
$forms->show("firstname", "admin");
// custom function for each line of the table
function mytest($set) {
return ($set['admin'] == "1")? "i am admin": "no no";
}
// show and list attributes
$forms->setAttribute("admin", "listFunction", "mytest");
// create html
$forms->doit();
Live Sample
Custom Table List Functions
Or you can use your own function to create the layout.
Sample Code
// create form object
$forms = new pnFormTrash("people");
// custom function for each line of the table
function mytest($set) {
return "<table border='1'><tr><td colspan='2'>HUHA</td></tr>
<tr><td>$set[lastname]</td><td><a href=\"#\">copy?</a></td>
</tr></table><br/>";
}
// show and list attributes
$forms->addAttribute("firstname");
$forms->pnEnableSave = false;
$forms->pnShowActionLinks = false;
$forms->pnListFunction = "mytest";
// create html
$forms->doit();
Live Sample