[Agavi-Users] Making one argument to a validator optional

1 view
Skip to first unread message

Felix Gilcher

unread,
Aug 8, 2008, 12:59:02 PM8/8/08
to Mailing List Users Agavi
Hi all,

I have a minor problem writing my own validator: The validator can
handle two arguments but one is optional. This does not seem (easily)
possible with the current implementation: The Validator first checks
whether all arguments are set and bails out if not, never calling the
actual validation code. There is no way to pass the information 'this
parameter is optional' to the validator.

I could (and will now) overwrite AgaviValidator::checkAllArgumentsSet
() but that seems like an ugly solution - any chance that there might
be an easier solution in future agavi versions?

Something along the way of

<validator class="FooValidator"...>
<arguments>
<argument name="required_argument">..</argument>
<argument name="optional_argument" required="false">...</argument>
</arguments>
...

regards

felix

_______________________________________________
users mailing list
us...@lists.agavi.org
http://lists.agavi.org/mailman/listinfo/users

Reply all
Reply to author
Forward
0 new messages