dmuratov/yii2-universal-comment

Universal comment for yii2 framework

Maintainers

Package info

github.com/dmuratov/yii2-universal-comment

Type:yii2-extension

pkg:composer/dmuratov/yii2-universal-comment

Statistics

Installs: 454

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master / 1.0.x-dev 2016-01-14 13:52 UTC

This package is not auto-updated.

Last update: 2026-03-05 01:32:50 UTC


README

That library include Comment model and CommentBehaviour. It is simple and fast way to provide easy adding comments for others models.

Installation

The preferred way to install this extension is through composer.

Either run

composer require dmuratov/yii2-universal-comment:~1.0

or add

"dmuratov/yii2-universal-comment" : "~1.0"

to the require section of your application's composer.json file.

Usage

Adding behaviour for model:

public function behaviors()
{
    return [
        ...
        'comment' => [
            'class' => \dmuratov\comment\CommentBehaviour::className()
        ]
    ];
}

Adding comment for model


$model->addComment('Comment text');

Getting comments


$model->getComments()->all();