[TYPO3-mvc] Validating multiple arguments in one custom validator
Henrik M. Rasmussen
henrik at mocsystems.com
Tue Mar 1 16:15:57 CET 2011
On 01/03/11 16.09, Peter Bücker wrote:
>
> I did it like this: https://gist.github.com/849247. If you use this
> controller as your base controller, you can add an annotation like
> "@validateAll $foo $bar Tx_MyExt_Validation_Validator_FooBarValidator"
> to a controller action and it will validate those two arguments using
> Tx_MyExt_Validation_Validator_FooBarValidator->isValidAll($foo, $bar).
>
> Your validator class should extend
> Tx_Extbase_MVC_Controller_ArgumentsValidator and add errors to
> $this->errors as you would do with any other validator.
Looks awesome. Thanks for the fast reply Peter, I'll give it a try
tomorrow morning.
Best regards
Henrik
More information about the TYPO3-project-typo3v4mvc
mailing list