ywmm3951 / yii2-alidayu
alidayu for Yii2
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-05-10 23:22:11 UTC
README
alidayu for Yii2
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require ywmm3951/yii2-alidayu "dev-master"
or add
"ywmm3951/yii2-alidayu": "dev-master"
to the require section of your composer.json
file.
Usage
配置文件添加组件:
'components' => [
'alidayu' => [
'class' => 'ywmm3951\alidayu\SendCaptcha',
'appkey' => 'xxx', // 阿里大于 appkey
'secretKey' => 'xxx', // 阿里大于 secretKey
'signName' => 'xxx', // 短信签名
'templateCode' => 'xxx', // 短信模板ID
],
],
调用:
<?php
use Yii;
/**
* 发送验证码
* @return boolean true|false
*/
Yii::$app->alidayu->sendSMS($mobile, $content);