Anonymous
public text v1 · immutablefunction forum($forum_id)
{
$this->Forum->id = $forum_id;
$this->ForumThread->bindModel(array('belongsTo' => array('LastPost' => array('className' => 'User', 'foreignKey' => 'lastpost_user_id'))));
$this->paginate = array('conditions' => array('ForumThread.forum_id' => $forum_id), 'limit' => '15', 'order' => 'ForumThread.lastpost_time DESC');
$this->ForumThread->recursive = 1;
// data to view
$data = $this->paginate($this->ForumThread);
$this->set('data', $data);
}