Validating empty fields
Validating an optional field is a snap with CakePHP’s allowEmpty. But what if the field is only optional sometimes and under certain circumstances? A custom validation method, right? Well, actually no. See, if a field is optional (or, more accurately, ‘allowEmpty’ => true) then CakePHP will ignore any validation method, custom or otherwise. As it […]