Complete and flexible blogging platform for ProcessWire

Find Comments

We have previously looked at the method renderComments(), a method for outputting full comments for a Blog Post. In this lesson we briefly look at findComments(), a helper method used internally by its sister method findRecentComments() which we will address in the next lesson.

<?php
 /**
 * Find comments from the given selector string
 * 
 * Used internally in this class
 *
 * @access public
 * @param string $selector
 * @return $comments CommentArray
 *
 */
 public function findComments($selector)

The method accepts one argument, $selector which needs to be a string. Given a selector string, the method findComments() will find Blog comments according to that selector. The method does not output any markup but returns a CommentsArray. In 

Summary

We have briefly looked at the small helper method findComments($selector). This method is internally used by the method findRecentComments() to return an array of a limited number of recent Blog Comments.