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 133 entries

# ID Order no Order date Customer name Order amount Order status Actions
1 74 24386 2016-09-08 Cooper Jensen 70
2 75 49890 2016-09-08 Deacon Tyson 27
3 76 42911 2016-09-08 Cooper Jensen 24
4 77 75674 2016-09-08 Cooper Jensen 39
5 79 37102 2016-09-08 7
6 80 74040 2016-09-08 59
7 81 89592 2016-09-08 76
8 82 84334 2016-09-08 4
9 83 91414 2016-09-08 Kelly Garcia 91
10 84 89834 2016-09-08 Aubrey Leblanc 41
# ID Order no Order date Customer name Order amount Order status Actions