I have a problem … I have the version 1.1.1 but when I created with command yiic the crud I was not generated automatically the search as it appears in the guida.Someone can tell me why? Or can tell me how I can fix this?
I have a problem … I have the version 1.1.1 but when I created with command yiic the crud I was not generated automatically the search as it appears in the guida.Someone can tell me why? Or can tell me how I can fix this?
What’s the output of the cmd / terminal?
Like does it show the yiic shell actually creating the files?
If it’s not too much trouble, post step by step each command you type in. For example
Open Command Prompt
cd to web server directory
./yii/framework/yiic webapp WebAppName
…
Hope that makes sense. With that information we can have a better idea of what’s going on.
I made it i create my application with the command webapp, following the tutorial at
http://www.yiiframework.com/doc/guide/quickstart.first-app
Then I then created an .bat file that automatically brings me interactive tool v1.1
Hello Kitty,
I order to generate models and CRUD there are a number of requirements:
You must have a database
You must configure your application to use the database:
//in the file /protected/config/main.php
'db'=>array(
'connectionString'=>'mysql:host=localhost;dbname=your_database',
'username'=>'root',
'password'=>'',
'schemaCachingDuration'=>3600,
),
model Mytable
// the model will be generated
crud Mytable
// the crud will be generated
You must do the above for each of your database tables
Hallo Everyone,
i have the same problem, for information i try to make a Blog like in the "yii_blog_1.1.1.pdf" and i can generate any model but [color="#FF0000"]no CRUD[/color].
I have those tables in my database : tbl_comments, tbl_lookup, tbl_post, tbl_tag, tbl_user.
i generate model : see picture
but i cant generate CRUD : see Picture
what does that mean??
Thanks
It says your primary key has more than one segment (column). Check your table schema.
/Tommy
Okay i dont really know where is the problem… i post a picture of my db… just tell me what’s wrong with it!!
Thanks
If this is what you used for generating the model, I think the yiic shell shouldn’t complain about a composite primary key.
/Tommy
Hi tri!!
yeah u r right!! and now cmd shout me another error :
Error: Table "{{post}}" does not have a primary key
. Now im surprised!!
[color="#FF0000"]Edit : After restarting the Yii tool its works!![/color]
Thanks
Remember: You should always restart yiic shell, whenever you do changes to your database!