We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

phalcon session and jquery/javascript

Hi and good evening,

I'm writing an application with Phalcon and Bootstrap 3. I want to the users to be able to click on Bootstrap's panels (for selection) and store the selection in the session, because I use Phalcon's paginator to split the resultsets. I need to store the selections in the session-bag, because he must be able to navigate to the different pages and select multiple results. There is a button ('details') and when the user clicks it, all selected results will be shown in a more detailed view.

??? So the selection will be made with Javascript/jQuery. And I'm now wondering, how to use it with Phalcon's session ???

I hope you can help me again and wish you all the best for the new week!

Thanks alot



33.8k
Accepted
answer

Maybe calling AJAX when you click a selection, so it can store it in $this->session. Later, with Details, you do another AJAX call and get all $this->session values (in the action, you do a return $thing). Remember to disable views in AJAX actions for secure.

The only bad thing I see is doing a request per panel clicked. But well, Phalcon's strong point is his lowly request time.

edited Jul '14

Thx alot! Maybe I can reduce the traffic load when I optimize the program in the final steps :)