public function indexAction($postid)
    {
        $post = $this->getPost($postid);

        $entities = $post->getComments()->toArray();
        usort($entities, function (Comment $a, Comment $b) {
            return $a->getDateCreated() < $b->getDateCreated();
        });

        return array(
            'post'     => $post,
            'entities' => $entities,
        );
    }
public function indexAction($postid)
    {
        $post = $this->getPost($postid);

        $entities = $post->getComments()->toArray();
        usort($entities, function (Comment $a, Comment $b) {
            return $a->getDateCreated() < $b->getDateCreated();
        });

        return array(
            'post'     => $post,
            'entities' => $entities,
        );
    }
public function indexAction ( $ postid ) { $ post = $ this -> getPost ( $ postid ) ; $ entities = $ post -> getComments ( ) -> toArray ( ) ; usort ( $ entities , function ( Comment $ a , Comment $ b ) { return $ a -> getDateCreated ( ) < $ b -> getDateCreated ( ) ; } ) ; return array ( 'post' => $ post , 'entities' => $ entities , ) ; }
Lists all of a post's comments.

@Route("s", name="post_comments")
@Template()
Lists all of a post s comments .