array
Takes the array settings field.
param
Can be an array or string.
Example:
$this->setTypeField([
'field_name' => 'textarea' or 'text' or 'number' or 'tel' ...,
...
]);
Example:
$this->setTypeField([
'field_name' => ['radio', ['1' => 'Yes', '0' => 'No', '3' => 'Maybe']],
...
]);
Example:
$this->setTypeField([
'field_name' => ['checkbox', '1'],
...
]);
Example:
$this->setTypeField([
'field_name' => ['select', ['1' => '111', '2' => '222']],
...
]);
Example:
$this->setTypeField([
'field_name' => ['select', [CategoryModel::class, 'id', 'title']],
...
]);
Example:
/**
* category_contacts - Relationship table
*/
$this->setTypeField([
'field_name' => ['select', [CategoryModel::class, 'id', 'title'], 'multiple', [CategoryModel::class, 'category_contacts', 'contacts_id', 'category_id']],
... or
'field_name' => ['select', ['1' => 'Yes', '2' => 'No', '3' => 'Maybe'], 'multiple', [CategoryModel::class, 'category_contacts2', 'contacts_id', 'category_id']]
]);
file
Field Type
file_upload_directory
The name of the directory where the files are downloaded. public\file_upload_directory
If the multiple constant is set multiple downloads of files.
Example:
$this->setTypeField([
'field_name' => ['file', 'file_upload_directory', 'multiple'],
...
]);