1. Go to this page and download the library: Download miserenkov/yii2-sms 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/ */
miserenkov / yii2-sms example snippets
'components' => [
...
'sms' => [
'class' => 'miserenkov\sms\Sms',
'gateway' => 'smsc.ua', // gateway, through which will sending sms, default 'smsc.ua'
'login' => '', // login
'password' => '', // password or lowercase password MD5-hash
'senderName' => '', // sender name
'options' => [
'useHttps' => true, // use secure HTTPS connection, default true
],
],
...
],
/**
* return an float in case of successful or false in case of error
*/
Yii::$app->sms->getBalance();
/**
* $phones an string for single number or array for multiple numbers
* $message an string
*
* return an string sms identifier in case successful or false in case error
*/
Yii::$app->sms->send($phones, $message);
/**
* $id sms identifier
* $phone phone number of recipient
*
* return an array [
* status - status code
* status_message - status message
* err - error code
* err_message - error message
* send_time - timestamp of send
* cost - message cost
* operator - recipient operator
* region - recipient region
* ] in case successful or false in case error
*/
Yii::$app->sms->getStatus($id, $phone);
php composer.phar
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.