Reputation: 25
I am developing a project in yii, in that, i will register companies, for each registered company i will create one order form. This form will be dependent on fields entered by me while company registration. This order form will be different for each company. Depending on that form i want to create table in mysql database and also model, view, controller files automatically as i click on submit button. Can anybody help me to create this files of view, model and controller through my application and not by using gii tool. I have created table using createTable() function but not getting how to create model view files in yii
Upvotes: 1
Views: 823
Reputation: 1356
You can edit the gii template to suite your needs. Otherwise, if not needed, you should use gii and do a little adjustments on the model.
Upvotes: 0
Reputation: 8400
Just use the gii templates by including them after setting the right variables perhaps? You should be able to find them in framework/gii/generators/ folder. The template folders contain the files that gii uses to generate them. If they don't fit exactly, you could copy and modify them
That being said, I do want to point out that you have to make sure to do the correct chown's and chmod's after you have generated the php files, it's a pretty dangerous practice if you are planning to do that directly on a production machine.
Upvotes: 1