fieldTypeAddForm

fieldTypeAddForm(string $fieldName, string|ModelFieldType $fieldType[, array $permittedValues[, array $options]])

This function is used for cases that you need to change the field type but only for the add/insert form. You can choose any field type from the list of field types.

Both 3 below examples will have the exact same results:

$crud->fieldTypeAddForm('date_birth_year', 'numeric');

or:

$crud->fieldTypeAddForm('date_birth_year', GroceryCrud::FIELD_TYPE_NUMERIC);

or:


// At the beginning of the file
use GroceryCrud\Core\Model\ModelFieldType;
...
$myField = new ModelFieldType();
$myField->setDataType(GroceryCrud::FIELD_TYPE_NUMERIC);
$crud->fieldTypeAddForm('date_birth_year', $myField);