hi guys,
I have quite a few listings and pagination for these listings.
Now when a user deletes an item it redirects the user to the index page
(page 1), which is incorrect.
Therefore if a user was on page 3 and deleted an item on page 3 it should
just delete the item and keep the user on that page.
I know it gets more complicated when there are no more records for page 3
(for example) and the user needs to be on page 2 then. But I just want to
get a feeling of what is the best way to do that?
I currently have:
$this->redirect(array('action'=>'index'));
but if I try this (as a test):
$this->redirect(array('action'=>'index/page:3'));
it will redirect to page 3.
So would the best way to do it be that with each delete I add the page
number as an argument and then I can grab it with the $_GET variable (or the
correct CAKEPHP way - yet to figure out) and then based on that page
redirect the user to that page?
Or is there a better and simplier way that CakePHP implements? or am I going
about it the wrong way?
Please can you send me links or anything that can help, I have searched but
didnt really find any appropriate answers and also checked the API but it
wasn't helpful either.
thanks
angelo
--
View this message in context:
http://www.nabble.com/stay-on-current-page-once-delete-an-item-in-CMS-tp20679009p20679009.html
Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---