[FLOW3-general] Validation: I'm always having validation errors twice
Sebastian Kurfürst
sebastian at typo3.org
Fri Oct 14 08:23:00 CEST 2011
Hey Alexander,
>> /**
>> * @param \Acme\Users\Domain\Model\Registration $registration
>> * @return void
>> * @validate $registration
>> \Acme\Users\Domain\Validator\RegistrationValidator
>> */
>> public function
>> createAccountAction(\Acme\Users\Domain\Model\Registration
>> $registration) {
>>
>> }
>
> Actually I don't know whether the newAccountAction has to be given the
> object aka null but it works. So I do not think that's part of the
> mistake.
You don't need that; but there is still a bug in this area which we plan
to correct with 1.0 final. However, this is not related to your issue.
Validators are collected from three sources:
* @validate annotations in the model
* Domain Model validators. If, for model \Foo\Bar\Domain\Model\Baz, a
validator named \Foo\Bar\Domain\Validator\BazValidator exists, it is
*automatically called*
* @validate annotations in the *controller action*
So, as you adhere to the convention for domain model validators, you do
*not* need to specify it explicitely in the @validate annotation :-)
Greets,
Sebastian
More information about the FLOW3-general
mailing list