study code from yii framework