[SOLVED] Using yiic


i have a database table named "kmembers". Now i want to generate the model and crud functions with yiic tool. I want to use the name like "User" instead of "kmembers" for the controller, model and so on.

>> model User kmembers

  generate User.php

The following model classes are successfully generated:


If you have a 'db' database connection, you can test these models now with:




>> crud kmembers User

   generate UserController.php

      mkdir ***/protected/views/user

   generate create.php

   generate update.php

   generate list.php

   generate show.php

   generate admin.php

   generate _form.php

Crud 'user' has been successfully created. You may access it via:


Now if i access the page at the give url this message appears

include(kmembers.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

You should generate crud with the command

>> crud User

Be aware that the help text mentions a second module parameter, not model.


If i do this it outputs this message

>> crud User

Error: Table "User" does not have a primary key.

But the table has a primary key "id"

I just verified I could do this on 1.0.10 (with my existing User table)

model Usr User

crud Usr

Not sure about what difference an all lowercase tablename would make.

Are you using 1.0 or 1.1?

Maybe you should try to start from scratch if you didn’t already.