您的位置:首页 > 编程语言 > PHP开发

Yii中的页面跳转与传值

2015-09-09 18:07 531 查看
1、在同一个Controller中页面跳转:

$this->render('view页面',array('参数'=>'值'));

$this->render('news',array('result'=>'123','result1'=>'456'));

url重定向   $this->redirect(array('action方法'));

$this->redirect(array('getnews','id'=>1,,,,));


2、在不同的Controller中页面跳转:

$this->redirect(array('跳转到的controller/跳转到的controller里的action','参数'=>'值',,,,));

$this->redirect(array('user/getuser','id'=>1));
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: