All Projects → clyde-cn → yii2-dysms

clyde-cn / yii2-dysms

Licence: other
阿里云 dysms 官方 SDK 的 Composer 封装,支持 yii2 项目。

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to yii2-dysms

dysms
阿里短信接口
Stars: ✭ 68 (+423.08%)
Mutual labels:  aliyun, aliyun-sms, dysms
aliyun-oss-wordpress
使用阿里云对象存储 OSS 作为附件存储空间的WordPress插件。QQ交流群:887595381
Stars: ✭ 56 (+330.77%)
Mutual labels:  aliyun
yii2-admin-template
Yii2 application template targeted for backends.
Stars: ✭ 17 (+30.77%)
Mutual labels:  yii2
yii2-highlight
Yii2 Highlight.js extension
Stars: ✭ 14 (+7.69%)
Mutual labels:  yii2
LazyWaimai-Api
基于Yii2框架的LazyWaimai Api端,REST API架构风格的,使用Oauth2进行身份认证
Stars: ✭ 42 (+223.08%)
Mutual labels:  yii2
yii2-user
Flexible user registration and authentication module for Yii2.
Stars: ✭ 24 (+84.62%)
Mutual labels:  yii2
socks-proxy
优雅访问国外技术网站 方便程序员学习 按时收费 不用不花钱
Stars: ✭ 15 (+15.38%)
Mutual labels:  aliyun
anchors
Add anchor links to headings in your Craft CMS website content.
Stars: ✭ 47 (+261.54%)
Mutual labels:  yii2
hisite
Hisite Yii2 base project
Stars: ✭ 15 (+15.38%)
Mutual labels:  yii2
ali-img
阿里云图像处理工具包
Stars: ✭ 16 (+23.08%)
Mutual labels:  aliyun
TianChiProj
🏆🥈🥉 TianChiProj 天池
Stars: ✭ 22 (+69.23%)
Mutual labels:  aliyun
yii2-fileapi-widget
Yii2 FileAPI widget.
Stars: ✭ 51 (+292.31%)
Mutual labels:  yii2
yii2-formbuilder
A drag and drop form builder with jQuery for Yii2
Stars: ✭ 33 (+153.85%)
Mutual labels:  yii2
spreadsheet
Yii2 extension for export to Excel
Stars: ✭ 79 (+507.69%)
Mutual labels:  yii2
yii2-gtreetable
Extension of Yii 2 Framework, which is wrapper for bootstrap-gtreetable plugin, on the other hand it provides functionality which allows to save the nodes states into database.
Stars: ✭ 41 (+215.38%)
Mutual labels:  yii2
yii2-fullcalendar-scheduler
Yii 2 component for easy fullcalendar scheduler integration
Stars: ✭ 24 (+84.62%)
Mutual labels:  yii2
yii2-js-urlmanager
That extension provide a way to create urls from your frontend part.
Stars: ✭ 53 (+307.69%)
Mutual labels:  yii2
yii2-actionbar
A control bar with bulk actions for the GridView widget.
Stars: ✭ 32 (+146.15%)
Mutual labels:  yii2
aliddns
阿里云动态DNS解析。
Stars: ✭ 17 (+30.77%)
Mutual labels:  aliyun
slides
Alexander Makarov conference slides
Stars: ✭ 26 (+100%)
Mutual labels:  yii2

aliyun-dysms

安装

composer require "saviorlv/yii2-dysms:dev-master"

or添加下列代码在composer.json文件中并执行composer update 操作

{
    "require": {
       "saviorlv/yii2-dysms":"dev-master"
    }
}

设置方法

全局使用

在config/main.php配置文件中定义component配置信息

'components' => [
  .....
  'aliyun' => [
      'class' => 'saviorlv\aliyun\Sms',
      'accessKeyId' => '123455',
      'accessKeySecret' => '122345666'
    ],
  ....
]

代码中调用(调用短信发送接口示例)

// 单条发送
$response = Yii::$app->aliyun->sendSms(
            "孙坤峰", // 短信签名
            "SMS_76350132", // 短信模板编号
            "136*****134", // 短信接收者
            Array(  // 短信模板中字段的值
                "code"=>"12345",
                "product"=>"dsd"
            ),
            "123"
        );
        print_r($response);
        
//批量发送

$response = Yii::$app->aliyun->sendBatchSms(
            array("孙坤峰","孙坤峰"), // 短信签名
            "SMS_76350132", // 短信模板编号
            array("136*****134","180*****459"), // 短信接收者
            array(array(  // 短信模板中字段的值
                "code"=>"12345",
                "product"=>"dsd"
            ),array(  // 短信模板中字段的值
                "code"=>"123456",
                "product"=>"dsd"
            )),
            "123"
        );
//批量发送 签名、手机号、模板字段 数组长度必须相等

如上所示 180*******259收到的短信 签名是"孙坤峰" 内容为  123456
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].