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

Ikke
  • 99,403
  • 23
  • 97
  • 120
Silicon
  • 51
  • 1
  • 2
  • 3

3 Answers3

2

Try:

$this->redirect($this->createUrl('update', array('id'=>$model->id)));
Mike Doe
  • 16,349
  • 11
  • 65
  • 88
0

Make sure that

$this->render

Is at the very bottom of the method before all if statements and the redirect itself.

The Humble Rat
  • 4,586
  • 6
  • 39
  • 73
0

What about check to see if there are any space before or after the <?php inside view , controller, model file.

i mean at the top of the script, since it will output space, and making the redirect not functioning without showing error.

I had mine solved by found this.