- Add this file to application/libraries (or, if you are already extending the Validator class, add the contents there).
- Remove Validator alias from config/application.php in order to avoid conflicts.
"required_if_attribute" => "The :attribute field is required."to application/language/[language]/validation.php.
Define the rule using:
$rules = array( 'uses_framework' => 'required', 'preferred_framework' => 'required_if_attribute:uses_framework,==,1' );
This is, of course, easily extended.
I think break; -s needed after all case... but great! Thanks!