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

# Id First name Last name Address City State Zip Actions
1 36 MR. CASSANDRA graves 87987 1951 Turpis. Street Dickinson MS 14187
2 38 MR. KUAME huffman 793-1081 In, Av. South El Monte MA 80857
3 40 MR. COOPER JUSTIN jensen P.O. Box 138, 4309 Non Rd. Opelousas VA 93062
4 41 MR. DEACON tyson 156-1937 Ultrices Rd. Spokane Valley FL 76778
5 42 MR. DAWN potter 8472 Pellentesque Rd. Chesapeake OH 66729-1234
6 43 MR. ZANE calderon 739-7377 Nascetur Rd. Elsmere VA 62940
7 44 MR. CECILIA carney 3243 Lorem Ave Shawnee NM 22241
8 46 MR. GILLIAN kirk P.O. Box 570, 1525 Magna Av. Ada CT 30771
9 47 MR. WALLACE gillespie 550-2279 Tellus, Ave Missoula WA 96349
10 48 MR. RISA ayers Ap #948-9845 Mi Avenue Pass Christian OH 72881
# Id First name Last name Address City State Zip Actions