Hello,
I have 2 tables: authors(id, name, email) and books(id, title,
author_id).
I've created models for authors and books:
class Author extends AppModel {
var $name = 'Author';
var $hasMany = 'Book';
}
class Book extends AppModel {
var $name = 'Book';
var $belongsTo = 'Author';
}
And the 2 controllers:
class AuthorsController extends AppController{
var $name = 'Authors';
var $scaffold;
}
class BooksController extends AppController {
var $name = 'Books';
var $scaffold;
}
When I run http://localhost/relationship/books/ instead of showing at
author the name of the autor it shows me the id of the author.
Can somebody help me?
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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