public function testRedirectAddAttribute() { $r = new Response(); $re = new Redirect(); $re->set("foo", "bar"); $r->append($re); $expected = '<Response><Redirect foo="bar"></Redirect></Response>'; $this->assertXmlStringEqualsXmlString($expected, $r->asUrl(False)); }
// http://www.twilio.com/docs/api/twiml/conference $r = new Response(); $dial = new Dial(); $conf = new Conference('MyRoom', array('startConferenceOnEnter' => "true")); $dial->append($conf); $r->append($dial); $r->Respond(); /* <Response> <Dial> <Conference startConferenceOnEnter="True"> MyRoom </Conference> </Dial> </Response> */ // ======================================================================== // Set any attribute / value pair // You may want to add an attribute to a verb that the library does not // support. This can be accomplished by putting __ in front o the // attribute name $r = new Response(); $redirect = new Redirect(); $redirect->set("crazy", "delicious"); $r->append($redirect); //$r-> Respond(); /* <Response> <Redirect crazy="delicious"/> </Response> */