hi frenchescapes
in your model, you can choose which db field will be displayed as its name with: var $displayField = "name_of_the_field"; This will work with Model->generateList() which will return an array of id=>name. (I guess you use generateList for your drop down menu) and probably with scaffolding as well. and if it's not about drop down, you can of course get the name of the Type of your Event in your views like this: ($data is for exemple what Event->find() returns) <? echo $data['Type']['name'] ?> is it helpful ? +++++ clemos On 12/22/06, FrenchEscapes <[EMAIL PROTECTED]> wrote:
I have worked out how to populate drop down menus from an associated model, thanks to help from other posts (much appreciated). But I can't figure out how to use the foreign key to show a different value from the other table, ex. I have an Events table which hasOne Type, the 'id' of the Type is stored in the Events table, but when viewing an Events record I want it to show the 'name' from the Type table instead of the 'id'. >
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---