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 27 MR. KERRY grant P.O. Box 613, 193 Nullam St. Bloomington MN 59983
2 28 MR. WYOMING sullivan 9747 Volutpat Road Auburn Hills OR 85244
3 29 MR. REESE singleton 7322 Sagittis. Av. Schaumburg WY 97495
4 128 MR. TEST tester 123 live free sm ca 94939
5 33 MR. KAMEKO cox 181-6497 At Rd. Nenana AK 45163
6 34 MR. BRODY mccarty P.O. Box 588, 4717 Tellus. Street Vicksburg NJ 67362
7 35 MR. LANA england 576-4991 Enim Av. Johnstown FL 72504
8 36 MR. CASSANDRA graves 1951 Turpis. Street Dickinson MS 14187
9 37 MR. NICHOLAS brock 222-910 Amet Rd. Tonawanda IA 04308
10 38 MR. KUAME huffman 793-1081 In, Av. South El Monte MA 80857
# Id First name Last name Address City State Zip Actions