baha2odeh/yii2-nexmo
Composer 安装命令:
composer require baha2odeh/yii2-nexmo
包简介
Yii2 nexmo is a wrapper for the Nexmo PHP library. Allow yii2 application to use nexmo services.
README 文档
README
Nexmo yii2 wrapper. Enable nexmo services in yii2 application.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require dpodium/yii2-nexmo "*"
or add
"dpodium/yii2-nexmo": "*"
to the require section of your composer.json file.
Component Setup
Once the extension is installed, simply modify your application configuration as follows:
return [ 'components' => [ ... 'nexmo' => [ 'class' => dpodium\yii2\Nexmo\NexmoManager::class, 'config' => [ 'api.key' => API_KEY, //from nexmo 'api.secret' => API_SECRET, //from nexmo ], //leave blank if not applicable 'proxy' => [ 'host' => HOST, 'port' => PORT, ], ], ... ], ... ];
Usage
Sending message
Yii::$app->nexmo->sendSms(TO, FROM, 'Test Nexmo Message');
Receiving A Message
Yii::$app->nexmo->receiveMessage();
Fetching A Message
Yii::$app->nexmo->fetchMessage(MESSAGE_ID);
Starting a Verification
Yii::$app->nexmo->initVerification(NUMBER, BRAND);
Controlling a Verification
Trigger
Yii::$app->nexmo->triggerVerification(REQUEST_ID);
Cancel
Yii::$app->nexmo->cancelVerification(REQUEST_ID);
Checking A Verification
Yii::$app->nexmo->checkVerification(REQUEST_ID, CODE);
Searching For A Verification
Yii::$app->nexmo->searchVerification(REQUEST_ID);
统计信息
- 总下载量: 136
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD
- 更新时间: 2019-10-10