Im just moving over to cakePHP from Code Igniter and I bet its right in front of me, but i can for the love of god not figure out through the manual nor search the internet, how to access relationship data. For example, say I have two tables BOOKS and AUTHORS. When accessing /books/ and getting a list printed, i can have perhaps ID and Title printed, and author_id. But How do I actually print out the authors first and last name? its in the AUTHORS table?
This, in Code Igniter (using dmz) I simply wrote $book->author->first_name I just cant seem to find/figure out how its done in cakephp.
(Yes i have the relationship set up in the models)
very grateful for anyone to tell me how, or just point me to where to learn it. Not lazy, been looking, just cant find it.
regards, Jason
debug($books)on the retrieved data. If your relationships are set up correctly, the author should be in there.