The code residing in the messages controller directly under "Showing the Comments" in the tutorial doesn't work. Ian was kind enough to insert this, which does. It should replace what was previously shown in the tutorial.
public function action_view($id = null)
{
$message = Model_Message::find($id);
// get an array of comment models for this message
$comments = DB::select()
->from('comments')
->where('mid', $id)
->as_object('Model_Comment')
->execute()
->as_array();
// jam the objects into an array for the view
$data = array(
'message' => $message,
'comments' => $comments,
);
// setup view
$this->template->title = "Message";
$this->template->content = View::forge('messages/view', $data);
}
The code residing in the messages controller directly under "Showing the Comments" in the tutorial doesn't work. Ian was kind enough to insert this, which does. It should replace what was previously shown in the tutorial.