承接 simperfit/twilio-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

simperfit/twilio-bundle

最新稳定版本:1.2.0

Composer 安装命令:

composer require simperfit/twilio-bundle

包简介

A simple Symfony 2, 3 bundle for the official sdk provided by Twilio.

关键字:

README 文档

README

Symfony Twilio Bundle - by Fridolin Koch forked and update for Symfony 4.X by Hamza Amrouche

Build Status

Coverage Status

Scrutinizer Code Quality

About

This is just a wrapper for the official SDK provided by Twilio.

Installation

Add this to your composer.json file:

"require": { "vresh/twilio-bundle": "dev-master", }

Add the bundle to app/AppKernel.php

$bundles = array( // ... other bundles new Vresh\TwilioBundle\VreshTwilioBundle(), );

Configuration

Add this to your config.yml:

vresh_twilio: #(Required) Your Account SID from www.twilio.com/user/account sid: 'XXXXXXXX' #(Required) Your Auth Token from www.twilio.com/user/account authToken: 'YYYYYYYY' #(Optional, default: '2010-04-01') Twilio API version version: '2010-04-01' #(Optional, default: 1) Number of times to retry failed requests retryAttempts: 3

Usage

Provided services:

Service Class
twilio.api \Services_Twilio
twilio.capability \Services_Twilio_Capability
twilio.lookups \Lookups_Services_Twilio

Inside a controller:

class TelephoneController extends Controller { public function callAction($me, $maybee) { //returns an instance of Vresh\TwilioBundle\Service\TwilioWrapper $twilio = $this->get('twilio.api'); $message = $twilio->account->messages->sendMessage( '+14085551234', // From a Twilio number in your account '+12125551234', // Text any number "Hello monkey!" ); //get an instance of \Service_Twilio $otherInstance = $twilio->createInstance('BBBB', 'CCCCC'); return new Response($message->sid); } }

Inside a console command:

class SomeCommand extends ContainerAwareCommand { protected function configure() { $this ->setName('some:comand') ->setDescription('A command') ; } protected function execute(InputInterface $input, OutputInterface $output) { //returns an instance of Vresh\TwilioBundle\Service\TwilioWrapper $twilio = $this->getContainer()->get('twilio.api'); $message = $twilio->account->messages->sendMessage( '+14085551234', // From a Twilio number in your account '+12125551234', // Text any number "Hello monkey!" ); //get an instance of \Service_Twilio $otherInstance = $twilio->createInstance('BBBB', 'CCCCC'); print $message->sid; } }

Copyright / License

See LICENSE

统计信息

  • 总下载量: 435.79k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 45
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固