Passing Array Between Actions

I’m new to Yii and currently having problem with my code.

I have actionExecute in my controller which executes a query and renders the result (potentially huge amount of data) in a page with CGridView. What I want is a download link (or button) in the same page as the CGridView. How do I pass the query result to the action that handles the download link (or button)?

At least I have two options:

  1. Save the result in user state, which terribly burdens the server.

  2. Save the query string in user state, and when clicking download the query is executed again.

Thank you for your answers.


I think there may be variations on your actual code and db query, but I think I’d written a second db request, but using together with cache, thus serving results from cache if the result hasn’t changed.

The app I’m building is a query tool, so it matters not if it’s still using the previous result when the user clicks the download link.

Thanks for your answer.

[color="#006400"]/* Moved from Tutorials to Yii 1.1 General Discussion */[/color]