超级计算机囧囧囧's Archivers

From admin on 2012-12-11 09:33:34

YII-redirect使用

$this->redirect(array('/site/contact','id'=>12));
//http://www.localyii.com/testwebap/index.php?r=site/contact&id=12

$this->redirect(array('site/contact','id'=>'idv','name'=>'namev'));
//http://www.localyii.com/testwebap/index.php?r=site/contact&id=idv&name=namev

$this->redirect(array('site/contact','v1','v2','v3'));
//http://www.localyii.com/testwebap/index.php?r=site/contact&0=v1&1=v2&2=v3

$this->redirect(array('site/contact','v1','v2','v3','#'=>'ttt'));
//带anchor的 http://www.localyii.com/testwebap/index.php?r=site/contact&0=v1&1=v2&2=v3#ttt
跳转到绝对路径
$this->redirect('http://www.sunhaibing.com');

查看完整版本: YII-redirect使用

Tags: yii, 跳转


©超级计算机囧囧囧