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

# ID Order no Order date Customer name Order amount Order status Actions
1 65 94701 2016-09-08 Cooper Jensen 589
2 66 36440 2016-09-08 Xenos Clarke 8
3 67 37251 2016-09-08 64
4 69 9551 2016-09-08 89
5 71 91617 2016-09-08 57
6 72 78062 2016-09-08 56
7 73 87594 2016-09-08 7
8 74 24386 2016-09-08 70
9 75 49890 2016-09-08 27
10 76 42911 2016-09-08 24
# ID Order no Order date Customer name Order amount Order status Actions