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

# ID Order no Order date Customer name Order amount Order status Actions
1 48 50 2016-09-08 Risa Ayers 500 nah
2 50 77099 2016-09-08 Nola 20
3 52 44144 2016-09-08 Cheryl Bowers 26
4 53 62391 2016-09-08 kjuhkjuh 96
5 54 54999 2016-09-08 Lacota Bonner 5
6 55 83323 2016-09-08 Bradley Freeman 37
7 56 409 2016-09-08 Jasper Santiago 68
8 57 50683 2016-09-08 Hilary Conner 28
9 58 93143 2016-09-08 Zena Fox 38
10 59 48121 2016-09-08 Britanni Schmidt 1
# ID Order no Order date Customer name Order amount Order status Actions