I am using cakephp since few months, and I have a problem today that I don't know why it is not working as always.
I've got three table:
posts comments posts_comments
In the models, I set :
Comment Model:
var $hasAndBelongsToMany = array('Post');
Post Model
var $hasAndBelongsToMany = array('Comment');
Then in my controller, for example the PostController:
$this->set('comments', $this->Post->Comment->find('list', array('order' => 'Comment.id')));
And then in my Post View I have :
<?php
echo $this->Form->create('Post');
echo $this->Form->input('name', array('label' => 'Name', 'maxlength' => '100'));
echo $this->Form->input('Comment.Comment', array('label' => 'New Comment', 'type' => 'select', 'multiple' => true));
echo $this->Form->submit('Add', array('class' => 'button'));
?>
In my others projects it always worked ! I always had my "Comment" displayed on the list, but here, I don't know why it is not working, nothing is displayed, did I forgot something ?
Regards,
4m0ni4c.