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"));