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

# ID Order no Order date Customer name Order amount Order status Actions
1 66 88 1881-05-19 Cooper Jensen 31 Adana
2 71 91617 2016-09-08 57 Yozgat5
3 72 78062 2016-09-08 56
4 73 87594 2016-09-08 7
5 74 24386 2016-09-08 8
6 75 49890 2016-09-08 27
7 76 42911 2016-09-08 24
8 77 75674 2016-09-08 39
9 78 65775 2016-09-08 25
10 79 37102 2016-09-08 7
# ID Order no Order date Customer name Order amount Order status Actions