gordonmcvey / reefknot

Reefknot framework for PHP
Apache License 2.0
5 stars 0 forks source link

RequiredOnVal validation property updates #3

Closed gordonmcvey closed 12 years ago

gordonmcvey commented 12 years ago

Currently the RequiredOnVal property takes a value (either literal, or the value of a Field object) and determines whether the data it's validating is required or not based on the state of the data the validation is dependant on.

You can either specify that the data is required if the dependant data is empty, or that the data is required if the dependant data is not empty.

This is of limited usefulness.

Replacing the flag with a callback would give a lot more flexibility in determining whether or not the data is required based on the dependant data.

gordonmcvey commented 12 years ago

Decided to keep RequiredOnVal and added a RequiredOnCallback property to compliment it