PHP code example of xiaochengfu / yii2-mns

1. Go to this page and download the library: Download xiaochengfu/yii2-mns 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/ */

    

xiaochengfu / yii2-mns example snippets


'components' => [
      'mns'=>[
                 'class'=> 'xiaochengfu\mns\Module',
                 'config'=>[
                     'aliyun'=>[
                         'active'=>true, //true位开启,false为关闭
                         'accessId' => 'xxxx',
                         'accessKey' => 'xxxxxxxxx',
                         'endpoint' => 'http://xxxx.mns.cn-hangzhou.aliyuncs.com/',
                         'topicName' => 'xxx',
                         'smsSignName' => 'xxxx',
                     ],
                     'yunpian' => [
                         'active'=>false,
                         'apikey' => 'xxxxxx', // 请替换成您的apikey
                     ]
                 ]

             ],
]