To implement this feature I had created a a column replyTo which relates to the comment_id in the same table. The original comments have this as 0. The problem I face is what could be the best way to show them.
In my model, I have created a function nested_comments() to get them and in my view I was doing like, this.
<? foreach( $comments as $comment ): ?>
....
<? foreach( $comment->nested_comments() as $comm): ?>
But that is only fine if I have one level of nested comments. Actually, I wish if there was a way to do this in the view. I don’t wish to create another view file and controller for this purpose alone.
You can use function, Like below:
it’s not ready to use function, but you can work in the same way.