CRUDigniter can "look into" your database SQL dump, see the column types / names and automatically figure out form control types. If you follow the conventions below while creating your database, then CRUDigniter will automatically add these form validation rules to your add() and edit() methods.
Database Rule | Form Control Type | Notes |
---|---|---|
text, mediumtext or longtext | textarea | - |
tinyint(1) or boolean | checkbox | A checkbox is the best representation for a boolean field. Generally, a BOOLEAN or TINYINT(1) is chosen in MySQL for representing boolean values. |
column name contains the word "password" | password | - |
custom association value set via CRUDigniter | dropdown | more information here |
ENUM | dropdown | Use ENUMs only when your dropdown values are not foreign key entities but just text values that need to be selected from a list. If your dropdown values are linked to another table, then use associations instead |
everything else | text | - |