I am developing an application that dynamically creates database
tables. I know CakePHP is setup in such a way that one model is used
for one table, but I am wondering if there is a way around this.
Because the tables are created dynamically I will not be able to
generate the code for the model ahead of time. So, instead I will like
to use one model to switch between the different tables. Is this
possible?
I have tried $useTable but this requires that I know the table name
ahead of time and I haven't found a way to dynamically set this
variable. One possible solution I am thinking of is to write the
necessary code for the model into /app/models/ once I create the
table. So, if I create a table names 'cakes' I will write the
necessary code for the 'cake' model into /app/models/cake.php. I can
then reinitialize the $uses variable to $uses = array('Cake'...). The
problem is I'm not sure if this will work or if writing to the /app/
model/ folder poses a security risk.
Any ideas? Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---