Yii2.0 实现的短信发送
2015-09-28 00:00
776 查看
yii2-smser
Github项目主页 https://github.com/daixianceng/yii2-smserYii2 SMS extension (短信扩展)
包含中国云信、中国网建、商信通与云片网络接口
Installation
The preferred way to install this extension is through composer. Check the composer.json for this extension's requirements and dependencies.To install, either run
$ php composer.phar require daixianceng/yii2-smser "*"
or add
"daixianceng/yii2-smser": "*"
to therequiresection of yourcomposer.jsonfile.
Usage
return [ 'components' => [ 'smser' => [ // 中国云信 'class' => 'daixianceng\smser\CloudSmser', 'username' => 'username', 'password' => 'password', 'useFileTransport' => false ] ], ];
OR
return [ 'components' => [ 'smser' => [ // 云片网 'class' => 'daixianceng\smser\YunpianSmser', 'apikey' => '9b11127a9701975c734b8aee81ee3526', // 请替换成您的apikey 'useFileTransport' => false ] ], ];
Yii::$app->smser->send('15000000000', '短信内容');
License
yii2-smser is released under the BSD 3-Clause License. See the bundledLICENSEfor details.
相关文章推荐
- Yii2.0 分页LinkPager
- Yii2.0-ueditor-widget
- 从框架看PHP的五种境界及各自的薪资待遇
- PHP之——不同类型数据之间的比较规律
- !!!phpmysql更新操作字段自增一(三种引号)
- php多个数组求组合数
- (php)不用mysql 统计站点流量;test1;
- vsftpd自启动(开机启动)的三种方法
- PHP 邮箱操作的Action
- php表单提交,get 、post 和文件上传
- PHP学习基础
- PHP常用库函数
- Mac下搭建php开发环境
- Thinkphp ——config.php配置文件的作用域的说明
- ThinkPHP--url地址大小写问题
- ThinkPHP--模板与框架整合
- PHP X-sendfile实现文件下载
- ThinkPHP--控制器调用模板
- ThinkPHP--框架目录文件介绍
- PHP数组 与 JSON 互相转换 (json_encode和json_decode的使用)