asinfotrack/yii2-comments Yii2-comments is a behavior and a set of widgets to enable generic commenting on Yii2-ActiveRecord-Models

behaviorwidgetbundlecommentcommentsmodel

Yii2-comments

Yii2-comments is a behavior and a set of widgets to enable commenting on Yii2-ActiveRecord-Models

Advantages

This is not the first commenting extension. So why use this one? Those are some of the major advantages:

  • this extension works with composite primary keys
  • the handling and configuration couldn't be simpler
  • awesome widgets to show, list and add comments

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require asinfotrack/yii2-comments

or add

"asinfotrack/yii2-comments": "~0.8.2"

to the require section of your composer.json file.

Migration

After downloading everything you need to apply the migration creating the audit trail entry table:

yii migrate --migrationPath=@vendor/asinfotrack/yii2-comments/migrations

To remove the table just do the same migration downwards.

Usage

Behavior

Attach the behavior to your model and you're done:

public function behaviors()
{
    return [
        // ...
        'comments'=>[
            'class'=>CommentBehavior::class,

            //TODO: comment this
        ],
        // ...
    ];
}

Widget

The widget is also very easy to use. Just provide the model to get the audit trail for:

<?= Comments::widget([
    'model'=>$model,

    // some of the optional configurations
    //TODO: comment this
]) ?>

Changelog

Learn about the latest improvements.

Changelog

Changelog

Version 1.0.0

  • Min-Required PHP-Version 7.1
  • Toolbox dependency update

Version 0.8.2

  • fixed relation check for comments if user is not logged in.
  • fixed bug in comment created_by default validator

Version 0.8.1

  • Bugfix for PHP 7.2, count non countable types

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.0.0 is the latest of 4 releases



MIT license
Stats
7 github stars & 0 github forks
1 downloads in the last day
3 downloads in the last 30 days
292 total downloads