maybe ... dunno

$this_is_your_form_instance->setPostValidators(new yourCustomValidator());

On Thu, Jan 21, 2010 at 1:25 PM, johnnygri <[email protected]> wrote:

> Hi there,
>
> I have a rather complicated form of 50+ fields. The value of one of
> the first fields dictates whether validation should be performed on
> approximately half of the fields or not. These fields all need to be
> validated using native Symfony validators. As directed by the
> documentation I suspected that this is a time for a post-validator.
>
> However, it isn't clear to me how I go about using native Symfony
> validators within a post-validator, infact I'm pretty sure it won't
> work having run a simple test. I'm also wondering whether a custom
> validator schema might be the answer, but I can't quite see how (I've
> read the advanced forms page).
>
> The solution I've arrived at is a custom bind() method that calls a
> configureValidation() method, passing it the $taintedValues array.
> This configureValidation() method then defines the validators
> according to the submitted data and it works nicely.
>
> My main question is, would you regard this solution as a bit hacky -
> could there be a more elegant way of doing this?
>
> Thanks
> John
>
> --
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<symfony-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>
>
>
>


-- 
Have a nice day!
Alecs

As programmers create bigger & better idiot proof programs, so the universe
creates bigger & better idiots!
I am on web:  http://www.alecslupu.ro/
I am on twitter: http://twitter.com/alecslupu
I am on linkedIn: http://www.linkedin.com/in/alecslupu
Tel: (+4)0722 621 280

-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.

Reply via email to