PHP code example of liasica / yii2-clsms

1. Go to this page and download the library: Download liasica/yii2-clsms library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

liasica / yii2-clsms example snippets


'components' => [
  ...
  'clsms'        => [
    'class'        => 'liasica\clsms\Sdk',
    'account'      => 'your account',
    'pswd'         => 'your password',
    'sendUrl'      => 'your HttpSendSM',
    'batchSendUrl' => 'your HttpBatchSendSM',
    'signature'    => 'your signature',
    'tpl1'         => 'your tpl1',
    'tpl2'         => 'your tpl2',
    'tpl3'         => 'your tpl3'
  ],
]

$clsms        = Yii::$app->clsms;
$clsms->code  = 'your code';
$clsms->phone = 'your phone number';
$clsms->sendMessage($clsms->tpl1, TRUE);

$clsms        = Yii::$app->clsms;
$clsms->phone = 'your phone';
$codeArr      = $clsms->getCode();
var_dump($codeArr);

php composer.phar