PDOCrud Replace column value

Many times, we need to display different value of column than the value saved for example we save status as 0,1 and display as "Approved" "Not Approved". This can be easily achieved using the PDOCrud using tableColFormatting function and replacing the value of column.

  
                                $pdocrud = new PDOCrud(); 
                                //column_name, replace, array of value and replace value array (you can also write in one statement, rather than two)
                                $pdocrud->tableColFormatting("order_status", "replace",array("Completed" =>""));
                                $pdocrud->tableColFormatting("order_status", "replace",array("Pending" =>""));
                                echo $pdocrud->dbTable("orders")->render();
                                

Orders

Showing 1 to 10 of 105 entries

# ID Order no Order date Customer name Order amount Order status Actions
1 80 74040 2016-09-10 52
2 82 84334 2016-09-08 Xenos Clarke 7
3 83 91414 2016-09-08 Xenos Clarke 91
4 85 71212 2016-09-08 33
5 86 14459 2016-09-08 43
6 87 22844 2016-09-08 17
7 88 43892 2016-09-08 55
8 89 72412 2016-09-08 22
9 90 64889 2016-09-08 Xenos Clarke 46
10 91 5518 2016-09-08 Cooper Jensen 64
# ID Order no Order date Customer name Order amount Order status Actions