1. Go to this page and download the library: Download kriss/yii2-web-msg-sender library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kriss / yii2-web-msg-sender example snippets
use kriss\webMsgSender\WebMsgSender;
return [
'components' => [
// others
WebMsgSender::COMPONENT_NAME => [
'class' => WebMsgSender::class,
// config see WebMsgSender public attributes
// change like this
//'socketPort' => 2123
],
],
];
use kriss\webMsgSender\WebMsgSender;
use yii\helpers\Html;
WebMsgSender::getComponent()->getSender()->sendInfo('You Have A Message,' . Html::a('[clickMe]', 'http://www.baidu.com'));