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

# ID Order no Order date Customer name Order amount Order status Actions
1 51 37429 2021-03-11 Xenos Clarke 78
2 52 1234567 2016-09-08 Xenos Clarke 26
3 55 83323 2016-09-08 Xenos Clarke 37
4 56 409 2016-09-08 Cooper Jensen 68
5 57 50683 2016-09-08 Deacon Tyson 28
6 59 48121 2016-09-08 1
7 61 37748 2016-09-08 Cooper Jensen 73
8 63 37920 2016-09-08 67
9 64 28431 2016-09-08 5
10 65 94701 2016-09-08 25
# ID Order no Order date Customer name Order amount Order status Actions