[TYPO3-mvc] Validating nested objects on create

Sebastian Kurfürst sebastian at typo3.org
Wed Jan 5 17:27:48 CET 2011


Hey,

the syntax is as EBNF:


ValidatePattern
   = "@validate" { ValidatorDefinition ","} ValidatorDefinition;
ValidatorDefinition
   = ValidatorName[ "(" { ValidatorOption ,} ValidatorOption  ")" ]
ValidatorOption
   = OptionKey "=" ( '"' String '"' | Number )

ValidatorName = ... alphanumeric ...
OptionKey = ... alphanumeric ...

So stuff like:
@validate StringLength(minimum=5, maximum=10)
@validate StringLength(minimum="5", maximum=10), NotEmpty
@validate Number

is all valid and possible.

Hope this helps :-)

Greets,
Sebastian

PS: Could you create a small tutorial about validating nested objects on
http://forge.typo3.org/projects/typo3v4-mvc/wiki, under "Small Tutorials"?


More information about the TYPO3-project-typo3v4mvc mailing list