Download the PHP package poprigun/chat without Composer
On this page you can find all versions of the php package poprigun/chat. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download poprigun/chat
More information about poprigun/chat
Files in poprigun/chat
Informations about the package chat
poprigun-chat
poprigun-chat
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
<?= \poprigun\chat\widgets\StaticChat::widget([ 'template' => 'path', 'node => true, 'options' => [ 'dialogTime' => 0, 'messageTime' => 0, 'form' => '#poprigun-chat-send-form', ], ]);?>
<?= \poprigun\chat\widgets\ChatButton::widget([ 'options' => [ 'receiver_id' => $user->id, 'text' => 'Message', ], ] )?>
$(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', ], ], ], ], ],