2017 © Pedro Peláez
 

library yii2-sms

yii2-sms expand

image

maxwelldu/yii2-sms

yii2-sms expand

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

yii2-sms

Yii2 对应的短信扩展, (*1)

Build StatusLatest Stable Version Total Downloads Latest Unstable Version License, (*2)

Install

add maxwelldu/yii2-sms to composer.json, (*3)

$ composer update

OR, (*4)

$ composer require maxwelldu/yii2-sms

Configurtion

\# file app/config/main.php
<?php

return [
    'components' => [
       'sms' => [
            'class' => 'maxwelldu\\sdk\\Chuanglan',
            'apiAccount' => 'your chuanglan apiAccount',
            'apiPassword' => 'your chuanglan apiPassword',
            'apiSendUrl' => 'http://222.73.117.156/msg/HttpBatchSendSM',
            'apiBalanceQueryUrl' => 'http://222.73.117.156/msg/QueryBalance',
        ],
    ],
];

Usage

$phone = '18812345678';
// $phone = ['01234567890'];   # 可以为数组
// $phone = '12345678900,01234567890';  # 还可以号码与号码之间用空格隔开
$text ='sms content';
$sms = Yii::$app->sms;
if($sms->sendSms($phone, $text))
{
    //发送成功
} elseif ($sms->hasError()) {
    $error = $sms->getError()
    # "请求参数格式错误"
}

Run phpunit

composer install

please update apiAccount and apiPassword and mobile in tests/ChuanglanTest.php file, (*5)

./vendor/bin/phpunit

The Versions

20/04 2016

dev-master

9999999-dev https://github.com/maxwelldu/yii2-sms

yii2-sms expand

  Sources   Download

MIT

The Requires

 

The Development Requires

yii2 sms sdk

20/04 2016

v1.1

1.1.0.0 https://github.com/maxwelldu/yii2-sms

yii2-sms expand

  Sources   Download

MIT

The Requires

 

The Development Requires

yii2 sms sdk

14/01 2016

v1.0

1.0.0.0 https://github.com/maxwelldu/yii2-sms

yii2-sms expand

  Sources   Download

MIT

The Requires

 

The Development Requires

yii2 sms sdk