⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Redirect after insert or update



Cèsar Martí
  • profile picture
  • Member

Posted 18 April 2012 - 11:18 AM

Hi guys!

I know, some people asked this before, but I don't fins the solution. I have different groceryCRUDs in my applications. In one of them, instead of to redirect to the list I want to redirect somewhere else. For example...

[php]
$crud->callback_insert(array($this,'my_insert'));

function my_insert($post_array)
{
/* do whatever with the $post_array */
/* redirect to another controller */
}
[/php]

I was trying with...

[php]
header('Location: '.base_url().'controller');
echo '<script type="text/javascript">window.location.href = "'.base_url().'controller";</script>';
redirect('controller');
[/php]

Any of them is working. Allways it comes back to the list. Any idea, please? Thanks.

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 18 April 2012 - 12:06 PM

/topic/324-workaround-redirect-to-the-list-after-insertupdate-without-changing-the-core-functionality-of-gc/

Neeraj Singh
  • profile picture
  • Member

Posted 20 June 2016 - 13:10 PM

Hmm, you wanna redirect user on another controller/action by using $crud->callback_after_insert or something else..

 

Please, check this post might be its useful for you : link