Home > php教程 > php手册 > YII ACTION跳转

YII ACTION跳转

WBOY
Release: 2016-06-13 10:50:59
Original
1107 people have browsed it

我试过两种方法:


在action里面用:

$this->render('view',array(
'model'=>$post,
'param1'=>$param1,
'param2'=>$param2,
));

但是这个只是打开了另外一个action的view而已。

观察rul地址,action的名字并没有变。

这种方法有一个很不好地方就是如果这个方法是从GET或者POST过来的话,

如果有GET或者POST信息,

刷屏的时候会再次GET或POST,内容可能会变化。


还有一种方法就是用:www.2cto.com

$this->redirect(array('view','id'=>$model->id));
这种方法是真正的切换action,不会产生再次POST或者GET。

 

作者:georgelife7
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template