I'd like to add some extra validation to a Yii model.
I know it is simple enough to add in some logic to say a form field must be an exact length of 6 characters, however is it possible to set the rule to say the following:
if ($_POST['code'] == '')
then no validation needed
else
code string must be exactly 6 characters in length