Creating multiple model / controller / view in Gii

May I know if Gii can create multiple model at a single page as currently one model is created at one time?

(This question also apply to controller and view)

(Also, if it is possible to add as a new feature for the next version)

Please advise and thanks in advance.

By the way, are there any yii widgets or extension that can create multiple model as a work-around for the above question?

If you want to collect more (different types): here is a wiki

If you want to collect more instances of the same model class: tabular input.

Thanks Zaccaria for replying.

I think I might have misrepresent my questions. Actually, currently, Gii allows one to create a single model at a time as shown in "Step 2a. Yii Generates the Model Classes" of http://www.yiiframework.com/tour/.

I was wondering if one have 100 tables in their database and wish to use Gii to generate the Model classes of 100 tables, does one have to manual go thru each of every single table generation in Gii?

That is why I was wondering if there are any widgets or extension to help one to use Gii to generate 100 or X numbers of Model classes at a single page.

Thanks for your patience and hopefully I did not misinterpret your reply too.

But… have you tried gii?

I’m asking because when you click on the “Table Name” input field… on the right side opens a small help box… where is explained that you can enter a star ( * ) to generate models for all tables…

Thanks mdomba for the fast response.

Sorry, seems like I miss out the star (*) but suppose inside a particular schema / database, I have 100 tables and I would like to generate 80 of the 100 tables as 20 of the tables are not yet confirmed. So, how can I go about generate the 80 tables in Gii in a single page without going thru each of them?

Thanks in advance.

1 Like

If you would be to code that implementation… how would you solve it?

Even if there would be a list of all the tables (100 of them) it would be a real pain to check/uncheck only few of them…

So IMO you can use the * to make the models for all the tables… and if needed just delete those models that you don’t need…

Pressed ENTER to soon on my previous post :)

Again I’m asking you…

But… have you tried to use Gii ?

When you enter * for the model name… and click "Preview" you get the list of all the models that will be generated…

Then you can check/uncheck the models that you want/don’t want…

And only after that you click on "Generate"

Thanks mdomba.

I have tried Gii but as mention earlier, I miss out the star (*) while manually generate the model class in my project. Now, the project require to generate 100 tables and that is why I was wondering how to generate more tables’s model class in a single page.

Got your point and will be looking out for those instructions inside those "textbox" next to the textfields inside Gii as now I realize how important they are.

But I was wondering if possible to have a checkbox called "Every Table" next to the Table Name as it will be more obvious to user who wish to generate all tables and delete some at a later time?

For your consideration and thanks for you enlighten me.

Do you mean a checkbox that will select all the tables…

You have it in the header it’s called “Generate”