[FLOW3-general] Closed
Alexander Schnitzler
mail at alexanderschnitzler.de
Thu Oct 13 17:54:10 CEST 2011
Alright, after searching for hours I found the mistake in violating the
conventions.
Instead of just
> * @validate \Acme\Users\Domain\Validator\RegistrationValidator
it must be
> * @validate $registration \Acme\Users\Domain\Validator\RegistrationValidator
So, this thread can be considered as closed.
Am 13.10.2011 16:35, schrieb Thomas Layh:
> I wrote this stuff down in a tutorial some time ago. It is possible that it
> is a little bit outdated, but perhaps it helps anyway.
> http://www.layh.com/work/flow3-fluid/tutorials/flow3-password-validator.html
>
> Greetings,
> Thomas
>
>
> On Thu, Oct 13, 2011 at 16:28, Thomas Layh<thomas at layh.com> wrote:
>
>> Hi,
>>
>> I a not completely sure but I think what you want to do is to validate your
>> registration array or whatever it is.
>>
>> I wrote a passsowrd validator some time ago and the way I used the
>> annotations looked like that:
>>
>> * @param array $password
>> * @validate $password
>> \Layh\Events\Validation\Validator\PasswordValidator(minimumLength = 3)
>>
>> So in your case the line for the validation could look like:
>>
>> @validate $registration \Acme\Users\Domain\Validator\RegistrationValidator
>>
>> Perhaps it helps.
>>
>> Greetings,
>> Thomas
>>
>>
>>
>>
>> On Thu, Oct 13, 2011 at 16:14, Alexander Schnitzler<
>> mail at alexanderschnitzler.de> wrote:
>>
>>> Hey folks,
>>> in the manual there is a part about validation, since today I guess.
>>> http://flow3.typo3.org/**fileadmin/manual/nightly/**
>>> TheDefinitiveGuide/PartII/**Validation.html<
>> http://flow3.typo3.org/fileadmin/manual/nightly/TheDefinitiveGuide/PartII/Validation.html
>>>
>>>
>>> There it says:
>>>
>>>> Base model and supplemental rules are not covered by this tutorial.
>>>>
>>>
>>> Alright, I tried using my own validator, validating a whole model.
>>>
>>> /**
>>>> * @param mixed $registration
>>>> * @return void
>>>> * @validate \Acme\Users\Domain\Validator\**RegistrationValidator
>>>> */
>>>> public function createAccountAction($**registration) {
>>>> // something here
>>>> }
>>>>
>>>
>>>
>>> Being familiar with extbase I hoped that would work fine, but an
>> exception
>>> is thrown.
>>>
>>> TYPO3\FLOW3\Error\**ErrorHandler::handleError(8, "Undefined index:
>>>> argumentName",
>> "/var/www/public_html/FLOW3/**Data/Temporary/Developm…O3_*
>>>> *FLOW3_Validation_**ValidatorResolver_Original.**php", 199, array)
>>>>
>>>
>>> I guess this is because validators only work for model arguments (yet?),
>>> don't they? Differs the way of validating whole models from the one in
>>> Extbase? Is there a tutorial for that or do I just have to validate
>> without
>>> a validator class inside the controller?
>>>
>>> Anyone having an answer to this?
>>>
>>> Kind regards!
>>> Alex
>>> ______________________________**_________________
>>> FLOW3-general mailing list
>>> FLOW3-general at lists.typo3.org
>>> http://lists.typo3.org/cgi-**bin/mailman/listinfo/flow3-**general<
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general>
>> _______________________________________________
>> FLOW3-general mailing list
>> FLOW3-general at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
>>
More information about the FLOW3-general
mailing list