2017 © Pedro Peláez
 

yii2-extension yii2-dialog

Yii2 module for dialog

image

nullref/yii2-dialog

Yii2 module for dialog

  • Sunday, March 26, 2017
  • by ZAYEC77
  • Repository
  • 2 Watchers
  • 0 Stars
  • 35 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

yii2-dialog

Yii2 module for dialogs (WIP), (*1)

Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

composer require --prefer-dist nullref/yii2-dialog

or add, (*5)

"nullref/yii2-dialog": "*"

to the require section of your composer.json file., (*6)

Then add module to application config:, (*7)

...
'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., (*8)

Usage

You can use dialog widget(nullref\dialog\widgets\Dialog):, (*9)

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

The Versions