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

# ID Order no Order date Customer name Order amount Order status Actions
1 43 62940 2016-09-01 Xenos Clarke 46
2 48 72881 2016-09-08 Xenos Clarke 18
3 50 77098 2016-09-08 Xenos Clarke 20
4 52 44144 2016-09-08 Cooper Jensen 26
5 54 54999 2016-09-08 5
6 55 83323 2016-09-08 37
7 57 50683 2016-09-08 28
8 58 931435 2016-09-08 37
9 59 48121 2016-09-08 1
10 62 34490 2016-09-08 77
# ID Order no Order date Customer name Order amount Order status Actions