2

I have created one module using Giix Component. When i am performing create or update action, it renders create and update view properly. But after submitting form, it again calls same create or update method with request data and after calling save method when i set redirection using

$this->redirect(array('view', 'id' => $model->id));

statement. it shows blank screen.

I have also traced this issue and i found that code execution reaching till this statement but after this statement it stops execution. when i am commenting this statement action method executes its default render statement

$this->render('update', array('model' => $model,));

So Please help me what can be the issue with this.

Thanks in advance

4

3 回答 3

2

尝试:

$this->redirect($this->createUrl('update', array('id'=>$model->id)));
于 2012-12-26T15:09:27.403 回答
0

确保

$this->render

在所有 if 语句和重定向本身之前位于方法的最底部。

于 2013-09-13T10:00:24.260 回答
0

<?php检查内部视图,控制器,模型文件之前或之后是否有任何空格。

我的意思是在脚本的顶部,因为它会输出空间,并使重定向不起作用而不显示错误。

我找到了这个解决了我的问题。

于 2013-11-05T10:45:43.407 回答