code2magic / yii2-smsgateway
SMS gateway
0.2.0
2020-03-12 15:44 UTC
Requires
- php: ~5.6||>7.0 <7.2||~7.2
- ext-mbstring: *
- yiisoft/yii2: ~2.0.15
Requires (Dev)
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2024-11-12 23:33:36 UTC
README
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require code2magic/yii2-smsgateway --prefer-dist
or add
"code2magic/yii2-smsgateway": "*"
to the require
section of your composer.json
file.
Configuration
This extension is supposed to be used with composer-config-plugin.
Else look config/common.php for cofiguration example.
Usage
Use with DI
$sms_gateway = \Yii::createObject(SmsGateway::class);
$ms_gateway->send($phone, $text, [])
or as component
// config
'components' => [
// ...
'sms_gateway' => \code2magic\smsGateway\SmsGateway::class,
// ...
],
// usage
\Yii::$app->sms_gateway->send($phone, $text, [])