如何在yii中在重定向时传递参数 [英] how to pass parameter on redirect in yii

查看:34
本文介绍了如何在yii中在重定向时传递参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目正在使用 Yii 框架;

I am using Yii framework for my project;

在成功插入数据库后,我正在使用

I am redirecting page after success of insertion in database to another controller using

$this->redirect($this->createUrl('controller/action'));

$this->redirect($this->createUrl('controller/action'));

在重定向期间是否可以像在渲染中一样传递任何参数,

During the redirection is it possible to pass any parameters just like in render,

$this->render('selectRefiner', array('param' => $data)

$this->render('selectRefiner', array('param' => $data)

推荐答案

尝试:

$this->redirect(array('controller/action', 'param1'=>'value1', 'param2'=>'value2',...))

api yii 1, api yii 2

这篇关于如何在yii中在重定向时传递参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆