1. Go to this page and download the library: Download kareylo/cakephp-comments library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// in your view
<div class="row">
<h4>Commentaires</h4>
<ul class="comment-list">
foreach ($model->comments as $comment):
echo $this->Comment->comment($comment);
endforeach;
/** src/Template/Element/Comments/comment.ctp
* $connected is used to check is user is connected
*/
<div class="comment-avatar">
<i class="fa fa-user"></i>
</div>
<div class="comment-container">
<div class="comment-author">
<?= $comment->user->username;