Friday, December 5, 2008

Re: saving pagination position

In the end this is the solution I found. First is to use sessions. The
ticket I refer to is waaay old and it seems FF3 doesn't really handle
referer.
I have a paginated list where I can click on list items to edit them.

In my controller that handles the paginated list I add: $this->Session-
>write('back', $this->here);
$this->here is the relative URL of the page you're on and will also
include page and sort since those are also in the URL.

Then in my edit function inside an if statement that makes sure the
edit is successful I add $this->redirect($this->Session->read
('back'));

Sooo, on the surface this seems to be working. I'm not very good with
php so if anyone has any suggestions or sees any potential problems it
would be good to hear.

On Dec 5, 2:37 pm, kai <k3hO...@gmail.com> wrote:
> How can I save the pagination position in my session so that when
> someone goes back to the list they are on the same page and same sort.
> I'm having trouble saving my pagination in a session. Can I somehow
> use referrer to do this?
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: