i am new to yii, i was developing a site. I have some 19 tables in it. I use CRUD in GII to access the databases, so my doubt is whether i have to create 19 controllers and models to access all the databases?
how can i access two diff tables in single controller??
if your tables are all standalone Entity , may be you should create all models for them (one table need one model class) ,if some of these can’t be represented by an Entity( i assume that you are familiar with E_R designing ) you don’t need create a model for such table (for example : bridge table just for many_to_many relation, or some table have no obvious primary key).
for the controller , in crud actions you can access any model , the generated code often need to add some additional method to handle complex situations or you need to modify the default generated code . these generated code just a skeleton for you .
please read the wikis for some clues ,there are too many article for that , just give you the latest one
Thanks for the reply, consider i have 2 models, say content and user. After the index page is loaded it will display the user/create page, after ‘submit’ button is clicked i have to display the content/update page, which is not successful.