Moved.
are you using Yii 1 or 2? This part of forum is Yii2 but I can see Yii 1 overtones in your post!
I’m using Yii2.
There is no CUserIdentity and CFormModel in Yii2.
Your code is Yii1 not Yii2