Original Source
https://pdocrud.com/demo/pages/field-type-new
https://pdocrud.com/demo/pages/field-type
Default Field Types
PDOCrud automatically generates the type of field based on the data type/name of the column of table. For example, if your database column is of type integer then it will automatically generate the field as type numeric.
Apart from field type, PDOCrud also takes name into account for example if you have column name "email" in your table and data type defined is varchar then also it will convert field to type email. Ofcourse, you can override the type of field using the fieldTypes function.
$pdocrud = new PDOCrud();
//You can enable these settings directly from config
$pdocrud->setSettings("enumToSelect", true);
$pdocrud->setSettings("setToSelect", true);
echo $pdocrud->dbTable("field_types")->render("insertform");
Field Type Settings
Change the type of Fields in PDOCrud
By deafult, PDOCrud generates the field type based on the data type of the column and name of column in the database table. You can also change the type of field as required using the fieldTypes function.
$pdocrud = new PDOCrud();
$pdocrud->fieldTypes("about_yourself", "textarea");// 'input text' ==> 'textarea'
$pdocrud->fieldTypes("gender", "radio");// radio button
$pdocrud->fieldDataBinding("gender", array("male","female"), "", "","array");//add data for radio button
$pdocrud->fieldTypes("hobbies", "checkbox");// checkbox button
$pdocrud->fieldDataBinding("hobbies", array("Dance","Art","Games"), "", "","array");//add data for checkbox button
$pdocrud->fieldTypes("state", "select");// dropdown
$pdocrud->fieldDataBinding("state", array("Andhra Pradesh","Bihar","Patna","Gujarat","Madhya Pradesh"), "", "","array");//add data using array in select dropdown
$pdocrud->fieldTypes("country", "multiselect");// multiselect dropdown
$pdocrud->fieldDataBinding("country", array("India","Brazil","UK","Pakistan"), "", "","array");//add data using array in multiselect
echo $pdocrud->dbTable("users")->render("insertform");