[TYPO3-mvc] Creating a dynamic back-button for error page

Claus Due claus at wildside.dk
Wed Aug 10 12:54:41 CEST 2011


Hi Frank,

You can make a Validator which allows empty values, sure. But to validate one property in relation to another you need a combined Validator which takes entire model objects along with some configuration.

I think, but not sure, that you can subclass Extbase validators to override their behavior to allow empty values.

Cheers,
Claus

On Aug 10, 2011, at 12:34 PM, Frank Mey - NEW.EGO wrote:

> Thx claus,
> 
> another possible solution would be to let the properties be empty, but if
> something is 
> entered it should be validated to the given format. Is that possible ? Like
> if I validate 
> a model property to EmailAddress, Extbase wont let me save this field with
> an empty value right ?
> 
>> -----Original Message-----
>> From: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-
>> project-typo3v4mvc-bounces at lists.typo3.org] On Behalf Of Claus Due
>> Sent: Wednesday, August 10, 2011 11:19 AM
>> To: TYPO3 v4 MVC project
>> Subject: Re: [TYPO3-mvc] Creating a dynamic back-button for error page
>> 
>> Hi Frank,
>> 
>>> I got a "simple" task: Validate a model property depending on the value
> of
>> another property :).
>>> 
>>> This is: Property 1 has to be required, if property 2 is empty and vice
> versa.
>>> 
>>> My plan is to write a custom validator class but I would like to ask
>>> you as experts what would be the best point to do this ? Write a model
>> validator or validate it in the controller ?
>> 
>> If I remember correctly, a while back Franz Koch (?) solved this by
>> implementing a custom Validator to validate entire model objects, then ran
>> that validator from the Controller and manually processed the errors
>> returned.
>> 
>> Cheers,
>> Claus
>> _______________________________________________
>> TYPO3-project-typo3v4mvc mailing list
>> TYPO3-project-typo3v4mvc at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> 
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list