I’m almost embarassed to be asking this question because I suspect the answer is staring me in the face. I’m writing my first yii application, learning as I go along. I’ve set-up the following rule for one of my models -
array('password', 'required', 'on'=>'create'),
However, when testing, it appears not to work as I expected - ‘password’ seems to be optional on either creation or update while I want it to be required for creation but optional for update. If I change the rule to read ‘on’=>‘update’ it works fine, although the wrong way round for my purposes.