dev-master
9999999-devTwilio extension for Yii2 framework
MIT
The Requires
by Reinvently
yii2 sms twilio call
1.0
1.0.0.0Twilio extension for Yii2 framework
MIT
The Requires
by Reinvently
yii2 sms twilio call
Twilio extension for Yii2 framework
$ composer require reinvently/yii2-twilio
Add the following config to the components
section to the config/web.php
, config/console.php
, etc.:, (*1)
... 'twilio' => [ 'class' => 'Reinvently\Twilio\Twilio', 'number' => 'XXXXXXXX', // phone number 'retries' => 5, // call retries in fail cases 'account' => [ 'sid' => 'ACXXXXXXXXXXXXXXXXXXXXXX', 'token' => 'XXXXXXXXXXXXXXXXXXXXXXXX', ], 'twiMLApp' => [ 'sid' => 'APXXXXXXXXXXXXXXXXXXXXXX', ], 'apiKey' => [ 'sid' => 'SKXXXXXXXXXXXXXXXXXXXXXX', 'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXX', ], 'configurationProfile' => [ 'sid' => 'VSXXXXXXXXXXXXXXXXXXXXXX', ], ], ... ]
Replace the necessary fields with your own twilio account data, which you can find in twilio control panel, (*2)
Sample useage in REST API controller:, (*3)
namespace app\controllers; use yii\rest\ActiveController; class ApiController extends ActiveController { public $modelClass = ''; public function actionGetVoiceAuthToken() { return \Yii::$app->twilio->generateVoiceAuthToken(); } }
Twilio extension for Yii2 framework
MIT
yii2 sms twilio call
Twilio extension for Yii2 framework
MIT
yii2 sms twilio call