Skip to content

poprigun/chat

Repository files navigation

poprigun-chat

poprigun-chat

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require poprigun/chat "*"

or add

"poprigun/chat": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

php

'path', 'node => true, 'options' => [ 'dialogTime' => 0, 'messageTime' => 0, 'form' => '#poprigun-chat-send-form', ], ]);?> [ 'receiver_id' => $user->id, 'text' => 'Message', ], ] )?>

js

$(window).ready(function(){ poprigunChat.loadDialogs(); poprigunChat.listenServerDialog(); });

Template

Templates build with Handlebars

Migration

yii migrate --migrationPath=@vendor/poprigun/chat/migrations

Main config

'modules' => [ 'poprigun_chat' => [ 'class' => \poprigun\chat\PChatModule::className(), 'params' => [ 'pchat-settings' => [ 'userModel' => \frontend\models\User::className(), 'userAvatarMethod' => [ 'class' =>\frontend\models\User::className(), 'method' =>'avatar', ], 'userNameMethod' => [ 'class' =>\frontend\models\Profile::className(), 'method' =>'fullName', 'relation' => 'profile', ], ], ], ], ],