PHP Class CommentList, ProcessWire

Inheritance: extends SimpleExtension
Datei anzeigen Open project: ryancramerdesign/ProcessWire Class Usage Examples

Protected Properties

Property Type Description
$comments Reference to CommentsArray provided in constructor
$field
$options Default options that may be overridden from constructor
$page

Public Methods

Method Description
__construct ( CommentArray $comments, array $options = [] ) Construct the CommentList
getReplies ( integer | Comment $commentID ) : array Get replies to the given comment ID, or 0 for root level comments
render ( ) : string Rendering of comments for API demonstration and testing purposes (or feel free to use for production if suitable)
renderCheckActions ( ) : string Check for URL-based comment approval actions
renderItem ( Comment $comment, $depth ) : string Render the comment
renderStars ( Comment $comment )
renderVotes ( Comment $comment )

Protected Methods

Method Description
renderList ( $parent_id, $depth )

Method Details

__construct() public method

Construct the CommentList
public __construct ( CommentArray $comments, array $options = [] )
$comments CommentArray
$options array Options that may override those provided with the class (see CommentList::$options)

getReplies() public method

Get replies to the given comment ID, or 0 for root level comments
public getReplies ( integer | Comment $commentID ) : array
$commentID integer | Comment
return array

render() public method

Rendering of comments for API demonstration and testing purposes (or feel free to use for production if suitable)
See also: Comment::render()
public render ( ) : string
return string or blank if no comments

renderCheckActions() public method

Note that when it finds an actionable approval code, it performs a redirect back to the same page after completing the action, with ?comment_success=2 on successful action, or ?comment_success=3 on error. It also populates a session variable 'CommentApprovalMessage' with a text message of what occurred.
public renderCheckActions ( ) : string
return string

renderItem() public method

This is the default rendering for development/testing/demonstration purposes It may be used for production, but only if it meets your needs already. Typically you'll want to render the comments using your own code in your templates.
See also: CommentArray::render()
public renderItem ( Comment $comment, $depth ) : string
$comment Comment
return string

renderList() protected method

protected renderList ( $parent_id, $depth )

renderStars() public method

public renderStars ( Comment $comment )
$comment Comment

renderVotes() public method

public renderVotes ( Comment $comment )
$comment Comment

Property Details

$comments protected_oe property

Reference to CommentsArray provided in constructor
protected $comments

$field protected_oe property

protected $field

$options protected_oe property

Default options that may be overridden from constructor
protected $options

$page protected_oe property

protected $page