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

# ID Order no Order date Customer name Order amount Order status Actions
1 66 36440 2016-09-08 Heather Terrell 8
2 67 37251 2016-09-08 Rose Barry 64
3 68 35643 2016-09-08 Bernard Gilmore 95
4 69 9551 2016-09-08 Meghan Mack 89
5 70 44898 2016-09-08 Lillith Terrell 43
6 71 91617 2016-09-08 Jaquelyn James 57
7 72 78062 2016-09-08 Karly Beard 56
8 73 87594 2016-09-08 Kareem Cooke 7
9 74 24386 2016-09-08 Amethyst Bass 70
10 75 49890 2016-09-08 Silas Bates 27
# ID Order no Order date Customer name Order amount Order status Actions