nullref / yii2-dialog
Yii2 module for dialog
Installs: 40
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.4.0
- nullref/yii2-core: dev-master
- nullref/yii2-useful: dev-master
- rmrevin/yii2-fontawesome: ^2.16
- yiisoft/yii2: >=2.0.6
This package is auto-updated.
Last update: 2024-12-18 23:27:40 UTC
README
Yii2 module for dialogs (WIP)
Installation
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist nullref/yii2-dialog
or add
"nullref/yii2-dialog": "*"
to the require section of your composer.json
file.
Then add module to application config:
... 'modules' => [ ... 'dialog' => [ 'class' => 'nullref\dialog\Module', 'components' => [ 'userManager' => [ 'class' => 'nullref\dialog\components\UserManager', 'modelClass' => 'your User model class', ], ], ], ... ], ...
User model class must implements nullref\dialog\interfaces\UserModel
.
Usage
You can use dialog widget(nullref\dialog\widgets\Dialog):
<?= nullref\dialog\widgets\Dialog::widget([ 'dialog' => $dialog, // instance of Dialog model (nullref\dialog\models\Dialog) 'user' => Yii::$app->user->getIdentity(), //instance of current user 'canWrite' => true, // allows write messages 'canDelete' => true, // allows delete own messages ]) ?>