albertborsos / yii2-clickatell
Yii2 扩展实现了 Clickatell SMS 发送功能
v0.4.1
2016-03-19 10:34 UTC
Requires
- php: >=5.4.0
- arcturial/clickatell: >=2.1.5
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-09-08 07:16:20 UTC
README
Yii2 扩展实现了 Clickatell SMS 发送功能
安装
安装此扩展的首选方式是通过 composer。
运行以下命令之一
php composer.phar require --prefer-dist "albertborsos/yii2-clickatell:0.4.*"
或者
"albertborsos/yii2-clickatell": "*"
将以下内容添加到您的 composer.json
文件的 require 部分中。
使用方法
扩展安装完成后,只需在配置中使用它,然后在您的代码中调用
'components' => array( ... 'clickatell' => array( 'class' => 'albertborsos\clickatell\ClickatellHttp', 'username' => 'your clickatell user', 'password' => 'your clickatell password', 'apiId' => 'your clickatell api id', 'from' => '+36xxxxxxxx' // optional parameter, 'mo' => 1 // optional parameter ), ... );
然后
Yii::$app->clickatell->sendMessage('+36xxxxxxxxx', 'Hello world!');