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

# ID Order no Order date Customer name Order amount Order status Actions
1 267 1 2023-04-04 Xenos Clarke 3212 1
2 268 0 0000-00-00 Cooper Jensen 656 a
3 269 1 0000-00-00 Xenos Clarke 1 1
4 270 0 0000-00-00 0
5 271 100 2023-04-20 1020
6 272 1 2023-04-05 100 2
7 273 12 2023-04-06 Xenos Clarke 5
8 274 3453 2023-04-19 0 sdaf
9 275 0 0000-00-00 0
10 276 0 0000-00-00 0
# ID Order no Order date Customer name Order amount Order status Actions