String Formatting of CRUD table column Format crud table column using string function

You can format table column using various string functions. For example you can make any table column content to uppercase, first letter uppercase, lowercase or you can add prefix, suffix etc.

  
                                    $pdocrud = new PDOCrud();
                                    //Add prefix (e.g. Mr.) in first name
                                    $pdocrud->tableColFormatting("first_name", "string",array("type" =>"prefix","str"=>"Mr. "));
                                    //make firstname upper case
                                    $pdocrud->tableColFormatting("first_name", "string",array("type" =>"uppercase"));
                                     //make lastname lower case
                                    $pdocrud->tableColFormatting("last_name", "string",array("type" =>"lowercase"));
                                     //Add suffix
                                    $pdocrud->tableColFormatting("Address", "string",array("type" =>"suffix","str"=>" "));

                                echo $pdocrud->dbTable("employee")->render();
                            

String based table content formatting

Employee

Showing 1 to 10 of 74 entries

# Id First name Last name Address City State Zip Actions
1 30 MR. ROSALYN spencer P.O. Box 296, 6612 Est. Ave Eatontown WV 88032
2 31 MR. SHELBY cohen P.O. Box 196, 4793 Volutpat. Rd. Basin IA 03952
3 32 MR. QUINN wiley P.O. Box 599, 2455 Accumsan Avenue Centennial SC 61389
4 33 MR. KAMEKO cox 181-6497 At Rd. Nenana AK 45163
5 34 MR. BRODY mccarty P.O. Box 588, 4717 Tellus. Street Vicksburg NJ 67362
6 35 MR. LANA england 576-4991 Enim Av. Johnstown FL 72504
7 36 MR. CASSANDRA graves 1951 Turpis. Street Dickinson MS 14187
8 37 MR. NICHOLAS brock 222-910 Amet Rd. Tonawanda IA 04308
9 38 MR. KUAMESS huffman 793-1081 In, Av. South El Monte MA 80857
10 39 MR. XENOS clarke 437-3387 Arcu Road Newburgh NV 05780
# Id First name Last name Address City State Zip Actions