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"));
Product id S10_1678
Product name 1969 Harley Davidson Ultimate Chopper
Product line
Motorcycles
ProductScale 1:10
ProductVendor Min Lin Diecast
Product description

This....

read more
Product image
Product url http://pdocrud.com/demo/pages
Qty available 7933
Product price 48.81
Product sell price 95.70
Tax 0
Product discount 5
Added date 12-20-2016