In CakePHP, is there a built-in way of validating a date to be within a certain range? For example, check that a certain date is in the future?
If the only option is to write my own custom validation function, since it’ll be pretty generic and useful to all my controllers, which is the best file to put it in?
AFAIK there’s no built-in validation for date ranges. The closest to it would be
range, but only if you expect all your dates to be UNIX timestamps.You can put your own validation method in the
AppModeland it’ll be available in all models.