Custom Validators
Closure/Lambda Validator
slug : {
required : true,
udf : ( value, target ) => {
if( isNull( arguments.value ) ) return false;
return qb.from( "content" )
.where( "slug", arguments.value )
.when( this.isLoaded(), ( q ) => {
arguments.q.whereNotIn( "id", this.getId() );
} )
.count() == 0;
}
},Custom CFC Validator
Defining Custom Validators
Error Metadata Integration
How Error Metadata Works
Accessing Error Metadata
Error Metadata in i18n Messages
ValidationError Metadata API
Best Practices for Error Metadata
Last updated
Was this helpful?