Skip to content

NullRefExcep/yii2-dialog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yii2-dialog

Yii2 module for dialogs (WIP)

Latest Stable Version Total Downloads Latest Unstable Version License

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
]) ?>

Releases

No releases published

Packages

No packages published

Languages