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

# Id First name Last name Address City State Zip Actions
1 22 MR. STONE kirkland P.O. Box 686, 9425 Morbi Road Colorado Springs UT 15525
2 24 MR. ADAM ramsey 6383 Euismod Road Fulton AZ 14148
3 25 MR. SERINA randolph Ap #832-9968 Cras Rd. Baltimore VT 02934
4 26 MR. ABRAHAM beasley 1146 Scelerisque, Road Pierre WV 10668
5 28 MR. WYOMING sullivan 9747 Volutpat Road Auburn Hills OR 85244
6 29 MR. REESE singleton 7322 Sagittis. Av. Schaumburg WY 97495
7 30 MR. ROSALYN spencer P.O. Box 296, 6612 Est. Ave Eatontown WV 88032
8 31 MR. SHELBY cohen P.O. Box 196, 4793 Volutpat. Rd. Basin IA 03952
9 33 MR. KAMEKO cox 181-6497 At Rd. Nenana AK 45163
10 34 MR. BRODY mccarty P.O. Box 588, 4717 Tellus. Street Vicksburg NJ 67362
# Id First name Last name Address City State Zip Actions