本文整理汇总了PHP中Redirect::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::set方法的具体用法?PHP Redirect::set怎么用?PHP Redirect::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redirect
的用法示例。
在下文中一共展示了Redirect::set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRedirectAddAttribute
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));
}
示例2: Response
// 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>
*/