Another Does Yii Allow To Create (Mysql) Database And Tables Dynamically ?
Posted 24 October 2013 - 03:31 PM
I'm just learning about Yii. I was wondering whether Yii allows to create (mysql) database and tables dynamically (for example based on a submitted webform by means of a controller)?
Appreciate your feedback
Posted 24 October 2013 - 08:00 PM
Have you read description how to work with database yet? You're highly encouraged to read whole yii guide as it describes all the basic framework approaches and functionalities.
Posted 25 October 2013 - 03:05 AM
As a matter of fact, it does. However, you shouldn't do this unless you are building a database administration tool like phpMyAdmin or chive, you really shouldn't.
Posted 25 October 2013 - 03:16 AM
Thanks for your reply. I have not read the entire manual yet (this is my 3rd day of reading about Yii), but I did read some of the tutorials, some of manual and searched for related topics on the forum.
If I understand correctly - for one creating dynamic databases one -e.g. some controller code- has to :
1. create the database and table (using plain php pdo code; that's easy)
2. edit the application configuration file in the protected directory
3.call the Gii tool to create the models for the table
The tutorials show how to edit the app config file and use the Gii tool manually, but I struggle to understand (/have not seen any example ) how controller code could perform these steps (2,3) automatically? Or do I miss something and do I take the wrong approach? (ps: the databases I need to create have all the same kind of tables but with different content )
Posted 25 October 2013 - 12:26 PM