dmuratov / yii2-universal-comment
Universal comment for yii2 framework
Installs: 454
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-12-11 20:02:12 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();