cbValidation
v3.x
v3.x
  • Introduction
  • Intro
    • Release History
      • What's New With 3.3.0
      • What's New With 3.2.0
      • What's New With 3.1.0
      • What's New With 3.0.0
      • What's New With 2.1.0
      • What's New With 2.0.0
    • About This Book
      • Author
  • Overview
    • Installation
    • Configuration
    • Declaring Constraints
      • Configuration File
      • Domain Object
      • A-la-carte
    • Available Constraints
      • Custom Message Replacements
      • Constraint Custom Messages
      • Nested Struct and Array Field Name Shortcuts
    • 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
On this page
  • Global Replacements
  • Validator Replacements

Was this helpful?

Edit on Git
Export as PDF
  1. Overview
  2. Available Constraints

Custom Message Replacements

We also setup lots of global {Key} replacements for your messages and also several that the core constraint validators offer as well. This is great for adding these customizations on your custom messages and also your i18n messages (Keep Reading):

Global Replacements

  • {rejectedValue} - The rejected value

  • {field or property} - The property or field that was validated

  • {validationType} - The name of the constraint validator

  • {validationData} - The value of the constraint definition, e.g size=5..10, then this value is 5..10

Validator Replacements

  • {DiscreteValidator} - operation, operationValue

  • {InListValidator} - inList

  • {MaxValidator} - max

  • {MinValidator} - min

  • {RangeValidator} - range, min, max

  • {RegexValidator} - regex

  • {SameAsValidator}, {SameAsNoCaseValidator} - sameas

  • {SizeValidator} - size, min, max

  • {TypeValidator} - type

username = { 
    required="true", 
    requiredMessage="Please enter the {field}", 
    size="6-8", 
    sizeMessage="The username must be between {min} and {max} characters" 
}
PreviousAvailable ConstraintsNextConstraint Custom Messages

Last updated 7 years ago

Was this helpful?