nanson / yii2-messenger
Private messages module for yii2
Installs: 261
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 4
Forks: 3
Open Issues: 0
Type:yii2-extension
Requires
- newerton/yii2-fancybox: dev-master
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-12-21 19:33:21 UTC
README
Private messages module for yii2
Installing
The preferred way to install this extension is through Composer.
{ "require": { "nanson/yii2-messenger": "*" } }
Migration
./yii migrate --migrationPath=@vendor/nanson/yii2-messenger/migrations/
Configure module:
'modules' => [
'messenger' => [
'class' => \nanson\messenger\Messenger::className(),
],
],
Usage
Url for contacts list: /messenger/contacts/
.
Url for messages list: /messenger/contacts/messages/?id={contact_id}
Contacts widget
Display contacts list for user with last message.
<?php echo \nanson\messenger\widgets\Contacts::widget(); ?>
Messages widget
Display user messages with current contact
<?php echo \nanson\messenger\widgets\Messages::widget([ 'contactId' => $contactId, ]); ?>
Add message widget
Display form to message creation.
<?php echo \nanson\messenger\widgets\AddMessage::widget([ 'contactId' => $contactId, 'pjaxId' => "pjaxMessages", ]); ?>
Messages counter widget
Display count unreaded messages for user.
<?php echo \nanson\messenger\widgets\Counter::widget(); ?>