Hey there, I've got a Campaigns model which belongs to a Charities
model. When a user signs up they are meant to first pick a charity the
id of which gets passed along to the regCampaigns function in the
Campaigns controller.
I'm trying to get three fields from the record of the charity they
picked (the $id which was passed), but I'm not sure how to do this
properly within the campaigns controller.
I've tried read, find, findById and have tried with containable
behaviour but for the life of me can't get just the three fields into
an array.
The fields are id (which I obviously already have) and image_url and
charity_name. I've been trying variations of:
$campCharity = $this->Campaign->Charity->read(array('image_url',
'charity_name'), $charity);
$this->set('campChar', $campCharity);
which is the best so far but it still tries to return all the
campaigns associated with the charity.
I know it's probably dead simple but I've been reading stuff for hours
and it's frustrating :(
--
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