> That's because many validators (f.i. Min) expect a non-string argument
> anyway. The other string arguments don't always accept empty values
> (like Regex, MinLength etc.)

> Is there any validator that should accept an empty string but does not?

The Url constraint for instance. How could you make it optional? if you
don't enter any value on the field, it would complain because the only way
it returns true is if $value === null . Maybe it would be better to have an
option "required" or something like that, that checks for $value === '' and
return true in that case?


Thanks.

And BTW.. I want to thank all of you guys who are contributing to this
amazing framework. GREAT job. I hope get enough knowledge of the internals
of the framework so I can start to contribute too :)




On Fri, Nov 26, 2010 at 2:07 PM, Bernhard Schussek <[email protected]>wrote:

> 2010/11/26 Gustavo Adrian <[email protected]>:
> > Thanks for clarify this point. But then there's a problem with this too.
> I
> > saw that validators check for null values like:
> > if ( $value === null )
> > {
> >     return true;
> > }
> > But they don't check for empty values.
>
> That's because many validators (f.i. Min) expect a non-string argument
> anyway. The other string arguments don't always accept empty values
> (like Regex, MinLength etc.)
>
> Is there any validator that should accept an empty string but does not?
>
> Bernhard
> --
> Software Architect & Engineer
> Blog: http://webmozarts.com
> Twitter: http://twitter.com/webmozart
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> 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
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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