当前位置: 首页 > 新闻动态 > 技术教程

yii怎么实现页面跳转

作者:王林 浏览: 发布日期:2020-02-17
[导读]:yii实现页面跳转的方法是:在不同的Controller中跳转,如【​$this->redirect(array(‘跳转到的controller/跳转到的controller里的action‘,‘参数‘=>‘值‘,,,,));】。

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,,,,));

相关教程推荐:yii框架

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

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

更多编程相关内容学习,请访问编程教程栏目!

免责声明:转载请注明出处:http://jing-feng.com.cn/news/759920.html

扫一扫高效沟通

多一份参考总有益处

免费领取网站策划SEO优化策划方案

请填写下方表单,我们会尽快与您联系
感谢您的咨询,我们会尽快给您回复!