General characteristics
All data types inherit from the base type represented by the ModelElement class, core/datatypes/base.type.php file and have the following additional parameters:
required
Purpose: makes this field mandatory to fill in when creating/editing a record
Possible values: true, false
Default: false
unique
Purpose: allows you to maintain unique values of this field in the table when creating/editing records
Possible values: true, false
Default: false
must_match
Purpose: used in forms to ensure that the value matches the value of another (usually for passwords)
Possible values: the name of the field from this model, for example 'name', 'password'
Default: null
help_text
Purpose: text with explanations for this field in the administrative part (can also be used in site templates)
Possible values: text
Default: null
html_params
Purpose: additional html parameters for this field in the administrative interface (class, dimensions, etc.)
Possible values: text, html attributes
Default: null
For all string types, the minimum and maximum length parameters are relevant.
length
Purpose: exact required field length (in utf-8 characters)
Possible values: positive integer
Default: null
min_length
Purpose: minimum field length (in utf-8 characters)
Possible values: positive integer
Default: null
max_length
Purpose: maximum field length (in utf-8 characters)
Possible values: positive integer
Default: null
min_max_length
Purpose: minimum and maximum field length (in utf-8 characters)
Possible values: string value in the form of 2 positive integers, separated by ','
Default: null
Examples:
['Name', 'char', 'name', ['required' => true]]
['File', 'file', 'file_price', ['help_text' => 'Downloadable file in .pdf format']]
['Link', 'url', 'link', ['required' => true, 'unique' => true]]
['Text', 'text', 'content', ['html_params' => 'class="wide" id="main-content"']]
['Repeat password', 'password', 'repeat-password', ['required' => true, 'must_match' => 'new_password']]