Re: [dfv] Data::FormValidator::Constraints::Upload
Status: Inactive
Brought to you by:
markjugg
|
From: Jiří P. <ji...@ge...> - 2011-02-21 21:17:50
|
On 21.2.2011 15:45, Mark Stosberg wrote: > On 02/20/2011 02:38 PM, Jiří Pavlovský wrote: >> Hello, >> >> I want to use Data::FormValidator::Constraints::Upload to validate photo >> upload. I want to check the image type and optionally (based on other >> parameter) its dimensions). >> I'm not quite sure what is the best way to handle the optional >> conditional constraint. >> What I did was to store the constraint subroutines returned by the >> appropriate methods in a variable and wrote my own constrain methods. >> I'm just not sure whether it is the best approach. > This looks Ok. > > If you want to have two constraints only have one be evaluated if the > first one passes, than you might use make_and_constraint() from the > ConstraintFactory module. > Thanks! |