Hi, thanks for responding. i get a Undefined index: Clients
I was thinking part of the problem is getting confused between the conventions surrounding pluralizing or not classnames. But i now seem to have eliminated any warnings at the top of the page about things like "Model "TaxAffiliate" is not associated with model "Client"" so now im tm not sure whats up. tick tick.... update: i workedit out. Thanks Hols, you set me off looking at it again and i realised: $this->Application->recursive = 2; is important! i didn't have this set, so it was only going 1 layer in. Brilliant, makes sense, can go to sleep happy. On Sep 21, 10:48 pm, Hols Kay <[email protected]> wrote: > What happens if you just use $application['Clients']['tax_rate'] in > your view instead of preceding it with your main model? > > On Sep 21, 8:42 am, "#2Will" <[email protected]> wrote: > > > Hi, Im getting in a muddle with associations. > > > I have tables > > > clients, tax_affiliates and applications > > > in my applications view, i want to show rate, which is stored in the > > client table. > > > $application['TaxAffiliates']['Clients']['tax_rate'] > > > but that gets me "Undefined index: Clients " > > > applications have a tax_affiliates_id and belong like this > > > var $belongsTo = array( > > 'TaxAffiliate' => array( > > 'className' => 'TaxAffiliate', > > 'foreignKey' => 'tax_affiliates_id', > > 'conditions' => '', > > 'fields' => '', > > 'order' => '' > > ) > > ); > > > taxAffiliates belong to clients like this: > > > var $belongsTo = array( > > 'Clients' => array( > > 'className' => 'Clients', > > 'foreignKey' => 'clients_id', > > 'conditions' => '', > > 'fields' => '', > > 'order' => '' > > ) > > ); > > > in my applications controler i have this > > > $this->Application->contain(array('TaxAffiliates'=>array('Client'))); > > > and in the app_model i have set var $actsAs = array('Containable'); > > > I have a feeling it's not even looking in the TaxAffiliate model, as > > when i delete it i get the same result. > > > appreciate any guidence towards being able to get at information > > deeper than the first level of association. > > > Thanks > > > Will. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
