ted
(Vincentmcgreevy)
1
I have a basic table:
Projects:
project_id (int) auto inc
project_name (varchar 255)
project_description (text)
I can generate a model (models\Projects.php)
When I try to use the CRUD generator, I entered ‘Projects’ as the Model Class, and ‘projects’ and Controller ID, I get this:
Class ‘Projects’ does not exist or has syntax error. I checked the syntax of the model and everything looks fine. Is there a potential path problem?
jacmoe
(Jacob Moena)
2
If you want to use the CRUD generator you need to follow conventions AFAIK.
Table name: project (all lowercase singular)
Field names:
id
name
description
Foreign key convention: tablename_id.
project_id means a foreign key pointing to the id field of the project table.
Read more about conventions in the guide, or in this wiki article:
http://www.yiiframework.com/wiki/227/guidelines-for-good-schema-design/
ted
(Vincentmcgreevy)
3
Wiped everything,
new table:
project
id (int) auto inc
name (varchar 255)
description (text)
Still getting same error! Can generate the model, but syntax / not found error.
jacmoe
(Jacob Moena)
4
You are closer.
What is your Gii setup?
Show us; complete with url rules and everything.