[TYPO3-mvc] Get another property in custom validator

Henk Scholten henk at wolfsstyle.nl
Fri Nov 1 11:33:18 CET 2013


Ok thank you, this works for me.

Philipp schreef op 31-10-13 14:53:
> you need the validation annotation above your controller action. Not
> your Model Property
>
> If you place a Validator above your property it is considered a property
> validator, you need an object validator, so you have to place it above
> your action....
>
>
> /**
> * action create
> *
> * @param \Pr\Sp\Domain\Model\User $newUser
> * @validate $newUser \Pr\Sp\Validation\Validator\UserValidator
> * @return void
> */
> public function createAction(\Profinit\Spiritit\Domain\Model\User
> $newUser) {
> }
>
> but i would make it in this specific case a little different.
>
> Submit both password and passwordConfirmation as separat arguments to
> your controller, check them there and if the comparison fails forward to
> your new action. Additionally you add a new flashMessage. If the
> confirmation is true you save a generated has as password in the model.
>
> That way you dont have a cleartext password in your model...



More information about the TYPO3-project-typo3v4mvc mailing list