with a schema like:
table name: user_defined_attributes
id (PK)
user_id (FK to your user)
attrb_title
attrb_description
table name: user_entries (table containing actual entries)
id (PK)
user_Id(FK to your user/s)
user_defined_attribute_id (FK to the above table)
entry_value
a model like this keeps users out of the actual DB structure manipulation (which is a big issue to have to address)
Cake can then handle this with its standard HABTM/HasMany construct.
Max H. Thayer
maxthayer@gmail.com
On Apr 26, 2011, at 10:31 PM, turbo2ltr wrote:
> I'm working on a system that needs to allow users to add their own
> attributes to the DB. For instance if you had a movies database, I
> need to allow the user to go into the attribute configuration and add
> "genre" which would allow every record in the movie DB to have a genre
> field. When they view a movie, it would need to dynamically render a
> view for all the custom attributes based on the attribute
> configuration.
>
> I've done this many times in PHP using link tables so I know how to do
> it. The biggest hurdle with learning cakePHP is knowing what it can
> do. I could code this up manually then find out there was an easy way
> to do it. I didn't see anything in the manual about it so I'm just
> asking....are there any features of cake that would make this specific
> task easy(er)? Or will I have to handle it all manually? Any tips
> for those that have done it already?
>
> Thanks,
> Mike
>
> --
> Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment