alexeevdv / yii2-sms-ru
yii2-sms-ru API 的 Yii2 封装器
dev-master
2017-11-28 14:27 UTC
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-08-29 03:36:06 UTC
README
yii2-sms-ru API 的 Yii2 封装器
安装
安装此扩展的首选方式是通过 composer。
运行以下命令之一:
$ php composer.phar require alexeevdv/yii2-sms-ru "dev-master"
或者将以下内容添加到您的 composer.json
文件的 require
部分:
"alexeevdv/yii2-sms-ru": "dev-master"
to the
require
section
of your
composer.json
file.
配置
通过应用程序组件
"components" => [ //... "sms" => [ "class" => "alexeevdv\sms\ru\Client", "api_id" => "YOUR_API_ID", ], //... ],
使用方法
use alexeevdv\sms\ru\Sms; $response = \Yii::$app->sms->send(new Sms([ "to" => "+9530000000", "text" => "Hello my friend!", ])); echo $response->code;