我认为这是一件非常容易的事情。假设,我正在查看控制器的相应功能。函数看起来像:
class SomeController extends AppController{
public function action(){
.
.
.
if($this->request->is('post')){
.
.
.
if(some error appears)
I want to get back to the "action" view with the data that was given to it before
else
continue processing
.
.
.
}
populate $data and send it to the view "action";
}
我的意思是,我只想随时返回到带有数据的特定视图。我用过redirect(array('controller'=>'some','action'=>'action'))
,但没有用。并且 usingrender()
不会占用 $data。请帮我。