title: Chat in Yii2 is not working
body: <p>Good day. I would like to add this <a href="https://github.com/sintret/yii2-chat-adminlte" rel="nofollow noreferrer">https://github.com/sintret/yii2-chat-adminlte</a> chat in yii2 to my project. I followed instructions but it's not working. help me please.</p>
  
  <p>I installed it via composer. </p>
  
  <pre><code>"sintret/yii2-chat-adminlte": "dev-master"
  </code></pre>
  
  <p>Create table</p>
  
  <pre><code>CREATE TABLE `chat` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `userId` INT(11) DEFAULT NULL,
    `message` TEXT,
    `updateDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
  ) ENGINE=INNODB;
  </code></pre>
  
  <p>Add in Controller</p>
  
  <pre><code>public function actionSendChat() {
      $message = $_POST['message'];
      if ($message) {
          $model = new Chat;
          $model -&gt; message = $message;
          if ($model -&gt; save()) {
              echo ChatRoom::data();
          } else {
              print_r($model -&gt; getErrors());
              exit(0);
          }
      }
  }
  </code></pre>
  
  <p>And in view</p>
  
  <pre><code> &lt;?php
              echo \sintret\chat\ChatRoom::widget([
                      'url' =&gt; \yii\helpers\Url::to(['/chat/send-chat']),
                      'userModel'=&gt;  \app\modules\user\models\User::className(),
                      'userField'=&gt;'avatarImage'
                  ]
              );
              ?&gt;
  </code></pre>
  
  <p>model User have avatarImage field.</p>
  
  <p>I changed <code>$message = $_POST['message'];</code> to <code>$message = \Yii::$app-&gt;request-‌​&gt;post('message');</code>
  Because when i tried to open <code>sendChat.php</code> there was a problem</p>
  
  <pre><code>Undefined index: message 
  </code></pre>
  
  <p>The problem with undefined message disappered, but view form sendChat.php was empty.</p>
  
  <p>After that i changed actionSendChat like this</p>
  
  <pre><code>    public function actionSendChat() {
  //        $message = $_POST['message'];
          $message = \Yii::$app-&gt;request-&gt;post('message');
          if ($message) {
              $model = new Chat;
              $model -&gt; message = $message;
              if ($model -&gt; save()) {
                  echo ChatRoom::data();
              } else {
                  print_r($model -&gt; getErrors());
                  exit(0);
              }
          }
          return $this -&gt; render('sendChat',
              ['model' =&gt; $message]
              );
      }
  </code></pre>
  
  <p>And it's shows chat like below.
  <a href="https://i.stack.imgur.com/MWHpz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MWHpz.jpg" alt="введите сюда описание изображения"></a></p>
  
  <p>When i equated variable $message from Controller to string 'Hello'; and then refreshed  view form <code>sendChat.php</code> this message had inserted in DB and then appeared in view form</p>
  
  <p><a href="https://i.stack.imgur.com/ULJM4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ULJM4.jpg" alt="enter image description here"></a></p>
  
  <p>Help me please. How can i fix this?</p>