cbValidation
Search…
v3.x
Introduction
Intro
Release History
About This Book
Overview
Installation
Configuration
Declaring Constraints
Available Constraints
Validating Constraints
Validating With Failures
Validating with shared constraints
Validating with a-la-carte constraints
Validating Custom Fields
Validating With Profiles
Displaying Errors
WireBox Integration
Advanced
Custom Validators
Unique ORM Validator
i18n Integration
Custom Validation Managers
Powered By
GitBook
Validating with shared constraints
We also have the ability to validate a target object or form with shared constraints from our configuration file. Just use the name of the key in the configuration form as the name of the
constraints
argument.
1
// validate user object
2
prc
.
results
=
validateModel
(
target
=
user
,
constraints
=
"sharedUser"
);
3
4
// validate incoming form elements in the RC or request collection
5
prc
.
results
=
validateModel
(
target
=
rc
,
constraints
=
"sharedUser"
);
Copied!
This will validate the object and
rc
using the
sharedUser
constraints defined in the
configuration file:
config/Coldbox.cfc
Previous
Validating With Failures
Next
Validating with a-la-carte constraints
Last modified
2yr ago
Copy link
Edit on GitHub