VDaemon PHP Library | VDaemon Extension | Table of Contents
Sometimes it is needed to validate a field against several different patterns or to validate data conditionally (one field depending on values from another fields). In other words it is needed to construct logical expressions with validators. vlgroup validator allows to define logical expression on its subvalidators.
vlgroup validator is just logical "OR", "AND" or "XOR" evaluation of all its subvalidators. In conjunction with logical "NOT" operation available for each "simple" validator ("negation" attribute) it gives you possibility to construct logical expressions of any complexity with your validation rules.
vlgroup validators can be nested since VDaemon version 3.0.0.
<vlgroup
name="validatorName"
operator="or"|"and"|"xor"
errmsg="errorMessage"
clientvalidate="true"|"false">
<vlvalidator ...>|<vlgroup ...>...</vlgroup>
...
</vlgroup>
Use the Name attribute to set the unique identifier name for the VDaemon vlgroup custom tag.
Determines type of logical operation. Can accept the following values:
Or - logical "or" operation.
And - logical "and" operation.
Xor - logical "xor" operation (available since version 3.0.4).
Default value is or.
Use the ErrMsg attribute to specify the text to display by the vlsummary custom tag when validation fails.
Determines if client-side validation for current validator will be performed. Default value is true.