Home >Backend Development >PHP Tutorial >YII ACTION jump_PHP tutorial
I tried two methods:
Use in action:
$this->render('view',array(
'model'=>$post,
'param1'=>$param1,
'param2'=>$param2,
));
But this just opens the view of another action.
Observe the rul address, the name of the action has not changed.
A very bad thing about this method is that if this method comes from GET or POST,
If there is GET or POST information,
When refreshing the screen, it will GET or POST again, and the content may change.
Another way is to use: www.2cto.com
$this->redirect(array('view','id'=>$model->id));
This method is a real switching action and will not generate another POST or GET.
Author: georgelife7