"char"
Purpose: single words, any values, short lines of the text.
Field type in SQL table: "char" or "varchar".
Additional parameters
"length"
Purpose: the exact required field length (in utf-8 characters)
Possible values: positive integer
By default: not set
"min_length"
Purpose: mandatory minimum length of the string
Possible values: positive integers
By default: not set
"max_length"
Purpose: the greatest possible length of the string
Possible values: positive integers
By default: not set
"min_max_length"
Purpsoe: maximum and minimum lengths of the string
Possible values: positive integers, separated by a comma
By default: not set
"hidden"
Purpose: an opportunity to create hidden fields, mainly used when
Сreating webforms
Possible values: "true"
By default: not set
"regexp"
Purpose: the value must match with a regular expression. Many data types derived from "char" have "regexp" property by default (for example "email", "redirect"). More details - in
Form fields validation rules section.
Possible values: PHP regular expressions as "/[a-z]{5}/"
By default: not set
"captcha"
Purpose: an opportunity to add a test code to a text field of a webform
Possible values: a path from the project's root to the file generating the image (without an initial "/")
By default: not set
Samples
array("Title", "char", "title") array("Name", "char", "name", array("required" => true, "min_length" => 5)) array("Articul", "char", "articul", array("required" => true, "unique" => true, "min_max_length" => "4,8")) array("Safety code", "char", "captcha", array("required" => true, "captcha" => "extra/captcha-simple/")) array("Skype", "char", "skype", array("regexp" => "/^w+$/"))
Example of CAPTCHA processing you can find in this section.
Previous section
"bool"