views:

23

answers:

0

I'ld like to configure my forms using config with an ini file. I need individualized error messages like the following one:

suche.elements.methode.options.validators.strlen.options.messages.stringLengthTooLong = "Der Suchbegriff '%value%' ist zu lang!"

This works well for strlen and regex, but how do I set it up for "required" elements? I tried stuff like

suche.elements.methode.options.validators.notempty.options.messages.isEmpty = "Der Suchbegriff darf nicht leer sein!"

but this throws exceptions.

Found a solution. This works:

suche.elements.methode.options.required = true
suche.elements.methode.options.validators.required.validator = "NotEmpty"
suche.elements.methode.options.validators.required.breakChainOnFailure = true
suche.elements.methode.options.validators.required.options.messages.isEmpty = "Der Suchbegriff darf nicht leer sein!"