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

# ID Order no Order date Customer name Order amount Order status Actions
1 49 3691 2016-09-08 Cooper Jensen 75
2 50 77099 2016-09-08 20
3 51 37429 2016-09-08 77
4 52 44144 2016-09-08 Bill Xenos Clarke 26
5 53 62391 2016-09-08 Cooper Jensen 96 Completedw
6 54 54999 2016-09-08 5
7 55 83323 2016-09-08 Bradley Freeman 37
8 56 409 2016-09-08 Jasper Santiago 68
9 57 50683 2016-09-08 Hilary Conner 28
10 58 931435 2016-09-08 Zena 37
# ID Order no Order date Customer name Order amount Order status Actions