I’m new in Yii Framework and I would like to render the commments associated to a given post. I tried to find solution but until now, I cannot figure out how to do it.
I have a list of posts and when I click a link I want to list the associated comments without refreshing all the page.
To be clear, I have the following
Post 1
My post 1 description … Comment (1)
Post 2
My post 2 description … Comment (3)
Post 3
My post 3 description … Comment (5)
and when I click to comment (3) of the post 2, I want the following
public function actionViewComment()
{
$id = $_GET['id'];
//do retrieve here by the post id
// echo the comment
}
here i pass the post id to the controller action via ajax and the id is available in the action and do some actions there and echo the result. the result is appeared inside the span with