PHP Class CommentList, ProcessWire

Inheritance: extends SimpleExtension
Afficher le fichier Open project: ryancramerdesign/ProcessWire Class Usage Examples

Protected Properties

Свойство Type Description
$comments Reference to CommentsArray provided in constructor
$field
$options Default options that may be overridden from constructor
$page

Méthodes publiques

Méthode 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 )

Méthodes protégées

Méthode Description
renderList ( $parent_id, $depth )

Method Details

__construct() public méthode

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 méthode

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

render() public méthode

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
Résultat string or blank if no comments

renderCheckActions() public méthode

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
Résultat string

renderItem() public méthode

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
Résultat string

renderList() protected méthode

protected renderList ( $parent_id, $depth )

renderStars() public méthode

public renderStars ( Comment $comment )
$comment Comment

renderVotes() public méthode

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