Redirecting to the proper page after actions
Jimmy Bourassa | November 29, 2008A couple days ago, a client I currently work for found a little annoyance with cakePHP default’s behaviour of redirecting to the index action after a delete or edit action, thus ignoring the page you were on.
Indeed, redirecting to $this->referer wouldn’t work in this case because the data is posted to the same action, therefore $this->referer = $this->here. The solution is quite simple, add this code to your action:
if ($this->referer != $this->here) $this->Session->write('referer', $this->referer);
Then, if your save method is successful, you can safely redirect with the Session variable that’s just been set :
$this->redirect($this->Session->read('referer'));
It’s pretty simple, but I guess it might come in handy. Thanks to TommyO from the irc channel for this hint!






look at this solution, also very nice if you can
cakemate | March 5, 2009look at this solution, also very nice if you can not rely on referer:
http://www.pseudocoder.com/archives/2008/01/24/cakephp-pagination-recall-component/
Every one understands that today's life is not very cheap,
ERMA26Mcdonald | November 9, 2011Every one understands that today’s life is not very cheap, however people require money for various issues and not every person gets big sums money. Hence to receive quick business loans and collateral loan will be good way out.