Hi Michal, currently this is not possible out of the box. You can however pass additional argument names as parameters, that's the only workaround that I'm aware of. Otherwise you could go the "right" route, overwrite "check_all_arguments_set" and extend the xsd schema and all of that.
However, you could also use some xml magic to call the validator with the proper set of arguments. That will evade the hacky route but will introduce some xml overhead. Basically you'd have a validator that sets a dependency when the optional argument is available and have two invocations, one that depends on the dependency and one that depends on the exact opposite. felix On Nov 4, 2009, at 9:40 PM, Michal Charemza wrote: > > On 4 Nov 2009, at 20:32, Guilherme Aiolfi wrote: > >> isn't <validator class="FooValidator" required="false"> what you are >> looking for? > > I don't think so. I want the validator itself to be required, just > that some of the arguments to be optional. The following is a > (simplified) example of what I would like: > > <validator class="MyValidator" required="true"> > <arguments> > <argument>requiredArgument</argument> > <argument>optionalArgument</argument> > </arguments> > <ae:parameters> > <ae:parameter name="export">exportedParameter</ae:parameter> > </ae:parameters> > </validator> > > I would like the validator to run even if "optionalArgument" has not > been submitted. However, if "requiredArgument" is not submitted, I > would like an error to be thrown. > > Michal. > > _______________________________________________ > users mailing list > [email protected] > http://lists.agavi.org/mailman/listinfo/users > _______________________________________________ users mailing list [email protected] http://lists.agavi.org/mailman/listinfo/users
