The preferred way to install this extension is through composer.
Either run
$ composer require dynamikaweb/yii2-chat "*"
or add
"dynamikaweb/yii2-chat": "*"
to the require
section of your composer.json
file.
use dynamikaweb\chat\Chat;
echo ChatView::widget([
'dataProvider' => $dataProvider,
'receive' => function ($model, $key, $index) {
return [
'right' => $index % 2,
'title' => $model->title,
'message' => $model->message
];
}
]);