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

# Id First name Last name Address City State Zip Actions
1 49 MR. CALLUM solomon 178-516 Ultrices. Rd. Fall River MD 03691
2 50 MR. NOLA rojas Ap #185-9503 Sed Street Juneau NH 77099
3 51 MR. TALON rowland 4575 Massa. Street Marquette IN 37429
4 52 MR. CHERYL bowers 1348 Ut Rd. Hutchinson IL 44144
5 53 MR. BREE gaines Ap #190-9800 Facilisi. Rd. Bowling Green ME 62391
6 55 MR. BRADLEY freeman 2339 Sit Rd. New Orleans WY 83323
7 56 MR. JASPER santiago 2990 Malesuada Rd. Williamsport IL 00409
8 57 MR. HILARY conner 2000 Diam. Rd. Roanoke MN 50683
9 58 MR. ZENA fox 9604 Dolor Road Palm Springs WA 93143
10 59 MR. BRITANNI schmidt 485-6357 Dictum Road Bradbury VT 48121
# Id First name Last name Address City State Zip Actions