Re: Redirect After Using render('action')

2009-09-25 Thread Tony Thomas

Thanks Brian,

I thought that might be the case.

On Sep 24, 7:30 pm, brian bally.z...@gmail.com wrote:
 Whether Cake spits out a CSV file or redirects to another
 controller/action, headers need to be sent to the client, but you
 can't send headers for both simultaneously.

 If you really want the form to disappear, use JS to submit the form
 using AJAX and hide/change certain elements of the page.

 On Thu, Sep 24, 2009 at 3:17 PM, Tony Thomas truet...@gmail.com wrote:

  I have a controller function that's using $this-render('action') to
  render a view that creates a CSV file after submitting some info in a
  form.

  What I want to do is redirect the user after the CSV file is
  downloaded. So the steps would be:

  1. User submits data.
  2. Queries are run and a CSV file is rendered and saved by the user.
  3. Controller redirects to another view.

  If I do a simple redirect using $this-redirect('controller/action'),
  the CSV file is not rendered, even though render() is called first. If
  I don't redirect, the CSV is successfully rendered, but the user is
  left with a form that is still filled-in. I'd like to redirect to
  another view and display a Success flash message once the CSV is
  rendered.

  Any tips?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Redirect After Using render('action')

2009-09-24 Thread Tony Thomas

I have a controller function that's using $this-render('action') to
render a view that creates a CSV file after submitting some info in a
form.

What I want to do is redirect the user after the CSV file is
downloaded. So the steps would be:

1. User submits data.
2. Queries are run and a CSV file is rendered and saved by the user.
3. Controller redirects to another view.

If I do a simple redirect using $this-redirect('controller/action'),
the CSV file is not rendered, even though render() is called first. If
I don't redirect, the CSV is successfully rendered, but the user is
left with a form that is still filled-in. I'd like to redirect to
another view and display a Success flash message once the CSV is
rendered.

Any tips?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Redirect After Using render('action')

2009-09-24 Thread Miles J

I dont believe you have any control at all regarding downloads.

On Sep 24, 12:17 pm, Tony Thomas truet...@gmail.com wrote:
 I have a controller function that's using $this-render('action') to
 render a view that creates a CSV file after submitting some info in a
 form.

 What I want to do is redirect the user after the CSV file is
 downloaded. So the steps would be:

 1. User submits data.
 2. Queries are run and a CSV file is rendered and saved by the user.
 3. Controller redirects to another view.

 If I do a simple redirect using $this-redirect('controller/action'),
 the CSV file is not rendered, even though render() is called first. If
 I don't redirect, the CSV is successfully rendered, but the user is
 left with a form that is still filled-in. I'd like to redirect to
 another view and display a Success flash message once the CSV is
 rendered.

 Any tips?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Redirect After Using render('action')

2009-09-24 Thread brian

Whether Cake spits out a CSV file or redirects to another
controller/action, headers need to be sent to the client, but you
can't send headers for both simultaneously.

If you really want the form to disappear, use JS to submit the form
using AJAX and hide/change certain elements of the page.

On Thu, Sep 24, 2009 at 3:17 PM, Tony Thomas truet...@gmail.com wrote:

 I have a controller function that's using $this-render('action') to
 render a view that creates a CSV file after submitting some info in a
 form.

 What I want to do is redirect the user after the CSV file is
 downloaded. So the steps would be:

 1. User submits data.
 2. Queries are run and a CSV file is rendered and saved by the user.
 3. Controller redirects to another view.

 If I do a simple redirect using $this-redirect('controller/action'),
 the CSV file is not rendered, even though render() is called first. If
 I don't redirect, the CSV is successfully rendered, but the user is
 left with a form that is still filled-in. I'd like to redirect to
 another view and display a Success flash message once the CSV is
 rendered.

 Any tips?
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---