Original Source
https://pdocrud.com/demo/pages/view-col-formatting
https://pdocrud.com/demo/pages/view-with-specific-columns
https://pdocrud.com/demo/pages/view-tabs
https://pdocrud.com/demo/pages/label
https://pdocrud.com/demo/pages/field-desc-tooltip
https://pdocrud.com/demo/pages/group-fields
https://pdocrud.com/demo/pages/set-field-value
https://pdocrud.com/demo/pages/field-class-attr
https://pdocrud.com/demo/pages/field-data-binding
https://pdocrud.com/demo/pages/add-static-fields
https://pdocrud.com/demo/pages/field-not-required
https://pdocrud.com/demo/pages/placeholder
https://pdocrud.com/demo/pages/input-addon
https://pdocrud.com/demo/pages/google-map
https://pdocrud.com/demo/pages/load-dependent-data
https://pdocrud.com/demo/pages/enum-field
View Col Formatting
Format view columns similar to table col formating (added in v 2.5)
You can format view form fields for date, image, html,read more, description and many more other options. date format allows you to pass any standard php date formatting string and data will be formatted according to that. image format makes value as image tag. long description can be made short with some character limit.
$pdocrud = new PDOCrud();
$pdocrud->setPK("product_id");
// convert to any html like url or any html with actual value passed as {col-name}
$pdocrud->viewColFormatting("product_line", "html", array("type" => "html", "str" => " {col-name}"));
$pdocrud->viewColFormatting("product_name", "html", array("type" => "html", "str" => "{col-name}"));
//convert to image column
$pdocrud->viewColFormatting("product_image", "image");
//convert long column text to small text with read more
$pdocrud->viewColFormatting("product_description", "readmore", array("length" => 4, "showreadmore" => true)); //not showing read more
// date formatting (pass date format)
$pdocrud->viewColFormatting("added_date", "date", array("format" => "m-d-Y"));
echo $pdocrud->dbTable("products")->render("VIEWFORM", array("id" => "S10_1678"));
View Form with Specific Columns
$pdocrud = new PDOCrud();
$pdocrud->setPK("id");
$pdocrud->setViewColumns(array("order_no","order_date","customer_name"));
echo $pdocrud->dbTable("orders")->render("VIEWFORM",array("id" =>"58"));
Multi Steps (Tabs) Form
You can divide the form tab wise also. You can show fields in different tabs. Please note that if you need tabs only in forms then you can turn off tabs in view form by setting $config["viewFormTabs"] = false or $pdocrud->setSettings("viewFormTabs",false);
$pdocrud = new PDOCrud();
$pdocrud->FormSteps(array("first_name", "last_name", "email", "phone", "gender","birth_date"), "General Info","tabs");
$pdocrud->FormSteps(array("user_name", "password"), "Login Details","tabs");
$pdocrud->FormSteps(array("address", "city", "state", "country", "zip_code"), "Address","tabs");
$pdocrud->FormSteps(array("hobbies", "educational_status", "about_yourself", "company_name"), "Other","tabs");
$pdocrud->setPK("user_id");
$pdocrud->setSettings("viewFormTabs", true);//set view form tabs enabled
echo $pdocrud->dbTable("users")->render("VIEWFORM",array("id" =>"26"));