首页 > PHP资讯 > PHP培训技术 > Yii框架下不同contoller之间的方法调用——redirect

Yii框架下不同contoller之间的方法调用——redirect

PHP培训技术

一个contoller Customer 使用方法

$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.baidu.com');

PHP培训技术

本文由欣才IT学院整理发布,未经许可,禁止转载。
支持9不支持0