I noticed that there is a class named 'Voucher' in root/protected/components/ folder that is causing above problem. Renamed it and issue resolved!
yii framework's CRUD generator (gii) shows error message : "'Voucher' must extend from CActiveRecord."
Question
I am trying to generate CRUD for my vouchers table using gii,I follow simple steps through which I always generate CRUD but this time with "vouchers" tables its showing some unexpected error message
'Voucher' must extend from CActiveRecord.
Below is how I am trying to generate the CRUD.
Step 1: Model Generation:
Her is generated voucher model located in root/protected/models/Voucher.php
Step 2: CRUD Generation:
Workaround:
I tried to generate CRUD with path alias for model class and it works, have a look at screen below
About workaround solved the problem but I wonder why CRUD generator is not generating the CRUD as normally it does with all other model names. I noticed that it shows this error only for "Voucher" model and for this specific model I have to go for above workaround.
Solution
OTHER TIPS
I noticed that same name in class name due to anothe error too.I prefer avoiding create Class with the same name in yii.