Overview
Defines that value of field must be in range definied by options.
Common Attributes
name | type | required | default value | description |
---|---|---|---|---|
name | string | yes | none | Name of the field, must be unique in this model scope. |
readonly | boolean | no | false | If true this field cannot be change by user. |
required | boolean | no | false | If true this field will be required (validator and "not-null" database's contraint will be added). |
copyable | boolean | no | true (except hasMany, manyToMany and tree fields) | If true value of this field will be copied during entity copy. Should be set to false for unique (see above) fields (except string and text). |
persistent | boolean | no | true | If true this field will be stored in database. |
Attributes
name |
type |
required |
default value |
description |
---|---|---|---|---|
from |
string |
no |
none |
Minimum value. |
to |
string |
no |
none |
Maximum value. |
exclusively |
boolean |
no |
false |
If 'false', when the value is same as 'from' or 'to', validator will accept. |
message |
string |
no |
none |
Message that will be displayed in case of error. |
Example
<validatesRange from="1" to="10" /> <validatesRange from="0" exclusively="true" message="error.value.must.be.positive"/> <validatesRange from="aa" to="bz" />