So I'm brand new to cakePHP, but I consider myself a pretty decent php developer. I'm trying to give it time to soak in, but at this point it would have been faster to write php. Hopefully someone can shove me in the right direction as I'd really like to learn this framework. I got my start by going through all of Andrew Perkins' video tutorials on youtube, which really give me a decent base to start from.
I've spent several hours on this, reading, searching and trying and I can't seem to find a good answer. I have a table "Parts" and one of the fields is "Type". Normally I'd just declare this as an enum with the values as "Part", "Assembly" and "Reference". I'm having a hell of a time trying to get cake to output a select tag with this data. While I found some workarounds in various blogs, I read that cake doesn't really know what to do with the enum type yet, I was able to manually create an array of types and pass it to the $form->select in the view which created the proper select tag, but hard coding the types might paint me into a corner down the road, and I couldn't seem to get the select to pre-select the current value in the edit action. So I decided to try an association. I created a table called part_types and related it to parts. I changed the type field to part_type_id. This relation worked (after a lot of trial and error...it was my first association), but did little to help me to automatically create the select tag. So I guess my question is, whats the standard way to do this? It seems so simple. 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 [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
