Twilio capability token generator

author Aleksey Korzun
package Library
subpackage Twilio\Utility

 Methods

Converts method calls into Twiml verbs.

__call(string $verb, array $attributes) : \SimpleXmlElement

A basic example:

php> print $this->say('hello');
<Say>hello</Say>

An example with attributes:

php> print $this->say('hello', array('voice' => 'woman'));
<Say voice="woman">hello</Say>

You could even just pass in an attributes array, omitting the noun:

php> print $this->gather(array('timeout' => '20'));
<Gather timeout="20"/>

Parameters

$verb

string

The Twiml verb.

$attributes

arraystring

Returns

\SimpleXmlElement

Constructs a Twiml response

__construct(\SimpleXmlElement | array $argument) : void

Parameters

$argument

\SimpleXmlElementarray

the element to wrap/attributes to add to the element. If nothing is passed we will initialize an empty element named 'Response'.

Exceptions

\Twilio\Utility\Exception\Twiml

Returns the object as XML.

__toString() : string

Returns

string

 Properties

 

$element : \SimpleXmlElement