Comments module, adds comments functionality to other modules

Integration of comments displaying:

$Page	= \cs\Page::instance();
$Comments	= null;
\cs\Event::instance()->fire(
	'Comments/instance',
	[
		'Comments'	=> &$Comments
	]
);
/**
 * @var \cs\modules\Comments\Comments $Comments
 */
$Page->content(
	$Comments ? $Comments->block($id) : ''
);

Where $id is integer identifier of article, page or anything else, that will be commented. $Comments - is object created by module, but you can use own object of class, which inherits cs\modules\Comments\Comments class.

Event for getting instance of Comments class:

$Comments	= null;
\cs\Event::instance()->fire(
	'Comments\instance',
	[
		'Comments'	=> &$Comments
	]
);
/**
 * @var \cs\modules\Comments\Comments $Comments
 */
if ($Comments) {
	//Some work here
}

Integration of comments adding, editing, and deleting.

For this module should support next triggers on comments module:

Other methods of Comments class:

There are several other methods, but they are used directly not so frequent, so, you can find them with description in source code and IDE suggestions.