Hello,
I am new to cake and seem to be having trouble displaying models when
using the hasMany associations.
When I run debug I can see all my table info is working properly,
Code:Array
(
[User] => Array
(
[id] => 1
[name] => Christopher
[account] => 89098
[group] => 1
)
[Profile] => Array
(
[id] => 1
[user_id] => 1
[image_url] => chris.jpg
[bio] => I am a Ruby and PHP developer using Ruby on Rails
and Cake PHP.
)
[Comment] => Array
(
[0] => Array
(
[id] => 2
[user_id] => 1
[title] => Today is a big day for Cake and Rails
[body] => Working hard to master Rails and Cake
frameworks
)
[1] => Array
(
[id] => 1
[user_id] => 1
[title] => Cake PHP Associations
[body] => Working with the hasmanys
)
)
)
I can access my user model and profile model, but get an index error
when I try to access the comment model.
I use this->$user[Profile]['image_url']; <-this works has_one assoc.
$user['Comment'][title] does not work.<-has_many.
Please help thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---