How can we do the following statement in topics Controller with paginate?
$posts=$this->Topic->Post->find('all',array('conditions'=>array('Post.topic_id'=>$id)));
Here my intention is that join the Topics and Posts tables, retrive the no of posts where topic id is matching in the posts table using paginate()
in cakePHP.
For example if topic id 1 have n no of posts. if change the topic id, that belongs posts will display using paginate()
.